HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

You are a trigger Expert.

08-01-2003, 07:15 AM#1
Panto
Greetings.

What do you suppose is wrong with these two related triggers?
Quote:
Trigger1:
Events:

Unit - A unit enters (Entire map)
Actions:
Set unitArraySpawn[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
Quote:
Trigger2:
Events:

Time - Every 8.00 seconds of game time
Actions:
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
Unit - Create 1 (Unit-type of unitArraySpawn[(Player number of (Picked Player))]) for (Picked Player) at ((Picked Player) start location) facing (Position of Castle 0012 <gen>)
08-01-2003, 07:25 AM#2
ceb5503
hmm...ok, let me get this straight. Your first trigger counts on someone creating a unit I assume and then that unit would get assigned into the array with the players #. The second trigger runs and then creates 1 more of this unit every 8 seconds.

Perhaps you can explain what isn't happening.
08-01-2003, 07:29 AM#3
Panto
What isn't happening is it isn't creating the unit at all every 8 seconds.

I put a debugging line in to say the name of the unit it creates, and it says nothing.
Does this mean the unit is not somehow getting entered into the array properly? Everything seems to be in order, to me.
08-01-2003, 07:32 AM#4
playamarz
Okay.. ignore what I just tried to explain.. My brain is currently fried... You are having problems storing units in the array is your main problem..

You have to change triggering unit to entering unit.. That's why.. Sometimes triggering unit won't work.
08-01-2003, 07:35 AM#5
ceb5503
He has one point, I don't know about all the server split stuff, but you could do a check to make sure that the variable isn't equal to no unit before it tries to create something.
And yes, it sounds like nothing is being assigned. How are you testing it? Are you building a unit from a building or buying it or what?

Edit: heh...good catch. It must be to late for me to think.
08-01-2003, 07:36 AM#6
playamarz
Also... You might want to check and make sure that the trigger you are trying to enter the unit in is of Unit-Type and not Unit.
08-01-2003, 07:50 AM#7
Panto
Indeed, playamarz, you are correct. It wouldn't spawn any more units because I was using a unit array and not a unit-type array.

I'm glad that there are some good trigger proofers here. You all get a trophy.


"Here The Cheat, have a trophy! Hooray, three trophies for The Cheat!"
08-01-2003, 07:52 AM#8
element_5
Quote:
Originally posted by Panto
"Here The Cheat, have a trophy! Hooray, three trophies for The Cheat!"
Maybe a pizza trophy :ggani:
08-01-2003, 07:59 AM#9
ceb5503
heh...yeah, good catch. My brain has been fried from working on my own map and I didn't think of that. heh....:)