View Full Version : I looked all over for help!!
TheOutcast
07-05-2007, 11:00 PM
My map could be delayed because I can't quite figure out some shit with the World Editor. My map has ten (-ish) people placed around my map and they all have to be killed, and they spawn at some point in the level. I'm trying to make it so all ten-ish people must be killed.
I tried making several triggers individually for each person that looks like this:
Event:
-A unit dies
Condition:
-Dying unit equal to Person01
Actions:
-Turn off this trigger
-Wait 0.50 seconds
-Run Check Persons <this is a trigger (initially off)
And the Check Persons trigger has a bunch of If/Then/Else actions in it saying:
If(units owned by player 12 equal to 9) then do (Display quest update message: there are nine people left to kill) else do nothing
I'm kinda pissed off because it's not working. The messages are not being displayed. If you can help me out with this without making me feel stupid, then please tell me what I gotta do! Thanx!:)
edwinfong25
07-05-2007, 11:34 PM
well, you could probably do that with only one trigger (kinda depends on how your map is set up...) ;)
first off, if all those units are owned by a single player and that player has no other units then you could just make a trigger that works something like this: :cool:
(Basically by Player)
Event - A unit owned by <Player> dies
Condition - None
Action - Quest - Display to (All players) the Quest Update message: ((There are + (String((Number of units in (Units owned by <Player>))))) + more unit(s) to kill.)
alternatively, if all the units that have to be killed are also the same unit-type... then you could just check for the unit-type, something like this: :cool:
(Basically by Unit-type)
Event - A unit dies
Condition - (Unit-type of (dying unit)) Equal to <Unit-type>
Action - Quest - Display to (All players) the Quest Update message: ((There are + (String((Number of units in (Units of type <Unit-type>))))) + more unit(s) to kill.)
or you could even combine those two methods ;)
lastly, (that i'm going to discuss for now, would be that you could just create a unit group for all those units that need to be killed (this would make it easier if the units have various unit-types, or if they are owned by various players, or if these unit types are used by other players, but only these ten need to be killed)
then simply you would make a variable for your unit group, then (probably in another trigger, the one that creates the units perhaps) you'd just add all the units into the unit group and then the trigger might look a bit like this: :cool:
(Basically by Unit Group)
Event - A unit dies
Condition - ((Dying unit) is in (<Unit Group>)) Equal to True
Action - Quest - Display to (All players) the Quest Update message: ((There are + (String((Number of units in (<Unit Group>)))) + more unit(s) to kill.)
keep in mind any of these can be combined and applied however you like ;)
additionally, if you really would prefer them to be in words (like "nine" instead of "9") then there are ways of doing that as well :)
well, these are just some basic ways that might help you to solve your problems ;)
(if they dont, then please explain your situation a bit further) :)
or if you have any further questions, then please do ask :)
TheOutcast
07-07-2007, 10:25 PM
Thanx for the help! But the only problem is that not all of the people spawn at once. I should've explained this before, but I was rushed. You see, I made it so that if you enter a certain region or so, the person will spawn randomly in front of you. If I did it this way, would I have to run a trigger every time one of the people spawn?
My idea was:
Event
-a unit enters PersonSpawn
Condition
-(Owner of Entering unit) equal to (player 1)
Actions
-turn off this trigger
-wait 0.50 seconds
-create a special effect at center of PersonSpawn using (spawn effect)
-create 1 Person for player 12 at center of PersonSpawn
-set Person01=(last created unit)
If I did this, I'm not sure how those triggers would work with this. I'm not sure what to do, besides running another trigger.
edwinfong25
07-07-2007, 11:37 PM
of course it'd still work, of course which one you decide to use is entirely up to you :cool:
(cuz my triggers merely check how many are left at the time at which one of those units were killed, your trigger that you're posting is merely spawning them) ;)
should work fine :)
as a matter of fact, you dont even need to set the unit to a variable
(unless you want to make a unit group to add all the units to)
(also a suggestion, instead of creating the special effect right at the middle of the region and then spawning the unit there... perhaps it'd be better to create the unit there, and then create a special effect attached to the unit instead (cuz the unit might get displaced if there's already something else there, and then the special effect wouldn't be right on the unit since it'd only go in the center of the region regardless of where the unit is)) ;)
well, hopefully that has solved your problem :)
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.