|
|
|
|
| Triggers & Scripts In this forum you may ask for help on fixing a trigger or script. But if you need help getting started with a trigger, this is not the right place — use the World Editor Help Zone. |
 |
10-14-2009, 08:32 PM
|
#1 (permalink)
|
|
Guess what?
Join Date: Aug 2009
Posts: 1,579
|
Help with Hash!
Ok,i have the following triggers in my map.I know it leaks,it is just fast made to see if it is working.I guess i do something wrong cause it doesn't work exactly as planned.Any suggestions?Here are the triggers:
 BuffFelOrcTowers
 MSFelOrcTowers
 RemoveBuffTowers
__________________
Windows Programmer ( C, C# )
|
|
|
10-14-2009, 09:40 PM
|
#2 (permalink)
|
|
Just "Hossomi" please x.x
Join Date: Dec 2005
Posts: 713
|
1. Two triggers have the Map Initialization event. Problem: the second depends on the first. Which of them happens first? You'd better make the first one run the second.
2. The second trigger uses (Triggering Unit) in its condition while no unit triggers the event. Therefore, (Triggering unit) == null.
3. Your use of hashtables makes no sense xD You should use keys that do not depend on the effect itself - your objective is to "get" it later, isn't it? So how are you going to get them if you actually "need" it to do so?
You could use the unit's key and then a number, meaning something like:
1 of unit = effect
__________________
"All your base are belong to us"
- God
|
|
|
10-15-2009, 10:10 AM
|
#3 (permalink)
|
|
Guess what?
Join Date: Aug 2009
Posts: 1,579
|
1st,ok i merged the first 2 triggers into one.
2nd,fixed triggering unit with picked unit.
3nd,i didn't exactly get it...an example ?
__________________
Windows Programmer ( C, C# )
|
|
|
10-15-2009, 10:28 AM
|
#4 (permalink)
|
|
I...make things
Resource Moderator
Join Date: Mar 2006
Posts: 7,617
|
 Hashtable - Save Handle Of(Last created special effect) as (Key effect_1) of (Key (Picked unit)) in Effect_Hash
^Use "Hashtable - Get string ID" for effect_1
 If (All Conditions are True) then do (Then Actions) else do (Else Actions)   If - Conditions
 If (All Conditions are True) then do (Then Actions) else do (Else Actions)   If - Conditions
^Those work the same way, use the lower version.
__________________
Current project:
|
|
|
10-15-2009, 10:39 AM
|
#5 (permalink)
|
|
Guess what?
Join Date: Aug 2009
Posts: 1,579
|
How about this?
 BuffFelOrcTowers
 RemoveBuffTowers Is this ok?
__________________
Windows Programmer ( C, C# )
|
|
|
10-15-2009, 10:40 AM
|
#6 (permalink)
|
|
Nevar guna give u up!
Join Date: Dec 2008
Posts: 622
|
Edit: Stop changing things before I post!!!! ARRGG
|
|
|
10-15-2009, 10:45 AM
|
#7 (permalink)
|
|
Guess what?
Join Date: Aug 2009
Posts: 1,579
|
Sorry^^ Didn't know you were posting,xD!
And how is this one?
__________________
Windows Programmer ( C, C# )
|
|
|
10-15-2009, 01:22 PM
|
#8 (permalink)
|
|
I...make things
Resource Moderator
Join Date: Mar 2006
Posts: 7,617
|
The hashtable usage looks ok.
 Set Temp_Group = (Units within 128.00 of Temp_Loc_2 matching ((((Matching unit) is alive) Equal to True) and ((((Owner of (Matching unit)) is an enemy of (Owner of (Picked unit)...
I'd pick the group like this instead of usin if/then/else.
And the
 ((Picked unit) is A structure) Equal to True
is redundant, since you have
 (Unit-type of (Picked unit)) Equal to Fel Orc Watch Tower
__________________
Current project:
|
|
|
10-15-2009, 07:30 PM
|
#9 (permalink)
|
|
Guess what?
Join Date: Aug 2009
Posts: 1,579
|
Ok,so this is the final trigger.
How about it?
 BuffFelOrcTowers
 RemoveBuffTowers
__________________
Windows Programmer ( C, C# )
|
|
|
10-15-2009, 07:44 PM
|
#10 (permalink)
|
|
I...make things
Resource Moderator
Join Date: Mar 2006
Posts: 7,617
|
Move the custom script out of the loop.
Use triggering unit instead of picked unit, forgot to mention that earlier.
  Actions
__________________
Current project:
|
|
|
10-15-2009, 07:49 PM
|
#11 (permalink)
|
|
Guess what?
Join Date: Aug 2009
Posts: 1,579
|
Done and thx :),i will +rep you once i spread :P
__________________
Windows Programmer ( C, C# )
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|
All times are GMT. The time now is 06:56 PM.
|