i'm workin' on an orpg and there each player needs to pick one hero to go throught the game. when you pick the hero, you start with some stuff like weapon etc... the problem is: it doesn't happen. the triggers:
here i set the variables, each integer (1, 2, 3...) has its respective hero and item given and also the icon to show on the multiboard. the player group action was made to count players making the triggers more organized.
here is the trigger that runs when the hero is picked:
in this trigger is set almost everything. the items are gave, the heros are saved in a hashtable, so i know which hero is the bag and which hero is the true hero when working on triggers. the problem is: the item is not created and the icon is shown as an empty green box. please, i need help on this.
also, if i can post in this section, when i pick the hero, there is an extreme lag and when i do a repick action, the skills in the spellbook of the hero repicked into aren't shown. thnx
-
Hero Init
-
Events
-
Map initialization
-
-
Conditions
-
Actions
-
Set hero_type[1] = Paladin
-
Set hero_type[2] = Warrior
-
Set hero_type[3] = Rogue
-
Set hero_type[4] = Archer
-
Set hero_type[5] = Mage
-
Set hero_type[6] = Priest
-
Set hero_startitem[1] = Stone Hammer (1)
-
Set hero_startitem[2] = Shortsword (1)
-
Set hero_startitem[3] = Small Dagger (1)
-
Set hero_startitem[4] = Simple Bow (1)
-
Set hero_startitem[5] = Sable Staff (1)
-
Set hero_startitem[6] = Sable Staff (1)
-
Set hero_icon[1] = ReplaceableTextures\CommandButtons\BTNArthas.blp
-
Set hero_icon[2] = ReplaceableTextures\CommandButtonsDisabled\DISBTNrpghero_by67chrome.blp
-
Set hero_icon[3] = ReplaceableTextures\CommandButtons\BTNPiratess_by67chrome.blp
-
Set hero_icon[4] = ReplaceableTextures\CommandButtons\BTNHighElvenArcher.blp
-
Set hero_icon[5] = ReplaceableTextures\CommandButtons\BTNSorceress.blp
-
Set hero_icon[6] = ReplaceableTextures\CommandButtons\BTNPriest.blp
-
Set hero_totaltype = 6
-
Set hero_startloc = (Center of HeroStartReg <gen>)
-
Set hero_altarloc = (Center of HeroAltarReg <gen>)
-
Hashtable - Create a hashtable
-
Set hero_hashtable = (Last created hashtable)
-
Hashtable - Create a hashtable
-
Set respawn_table = (Last created hashtable)
-
Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
-
Loop - Actions
-
Player Group - Add (Picked player) to player_playingplayers
-
Unit - Create 1 dummy for (Picked player) at hero_altarloc facing Default building facing degrees
-
Camera - Set (Picked player)'s camera Distance to target to 1800.00 over 0.00 seconds
-
-
-
-
here is the trigger that runs when the hero is picked:
-
Hero Pick
-
Events
-
Unit - A unit Sells a unit
-
-
Conditions
-
((Sold unit) is A Hero) Equal to True
-
-
Actions
-
Set hero_pick = (Sold unit)
-
Unit - Remove (Buying unit) from the game
-
Set multiboard_playerrow = (Load (Key row) of (Key (Owner of (Sold unit))) from multiboard_hashtable)
-
Unit - Move hero_pick instantly to hero_startloc
-
Hashtable - Save Handle Of(Sold unit) as (Key hero) of (Key (Owner of (Sold unit))) in hero_hashtable
-
For each (Integer generalintegers[1]) from 1 to hero_totaltype, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Unit-type of hero_pick) Equal to hero_type[generalintegers[1]]
-
-
Then - Actions
-
Camera - Lock camera target for (Owner of (Sold unit)) to (Sold unit), offset by (0.00, 0.00) using The unit's rotation
-
Unit - Create 1 Backpack for (Owner of hero_pick) at hero_startloc facing Default building facing degrees
-
Hero - Set (Last created unit) Hero-level to 80, Hide level-up graphics
-
Unit - Turn collision for (Last created unit) Off
-
Hashtable - Save Handle Of(Last created unit) as (Key backpack) of (Key (Owner of (Sold unit))) in hero_hashtable
-
Hero - Create hero_startitem[generalintegers[1]] and give it to hero_pick
-
Multiboard - Set the icon for leaderboard item in column 1, row multiboard_playerrow to hero_icon[generalintegers[1]]
-
For each (Integer generalintegers[2]) from 1 to hero_totaltype, do (Actions)
-
Loop - Actions
-
Player - Make hero_type[generalintegers[2]] Unavailable for training/construction by (Owner of (Sold unit))
-
-
-
Selection - Select hero_pick for (Owner of (Sold unit))
-
-
Else - Actions
-
-
-
-
Multiboard - Set the text for leaderboard item in column 6, row multiboard_playerrow to 1
-
Multiboard - Set the text for leaderboard item in column 4, row multiboard_playerrow to ((String((Integer((Life of (Sold unit)))))) + (/ + (String((Integer((Max life of (Sold unit))))))))
-
Set hero_pick = No unit
-
-
also, if i can post in this section, when i pick the hero, there is an extreme lag and when i do a repick action, the skills in the spellbook of the hero repicked into aren't shown. thnx