Page 1 of 1
Unit Kills and Spawning Q
Posted: Tue Jan 22, 2008 5:57 pm
by woner11
Is it possible to make it so that when one unit enters some type of region, everybody else on the map dies?
Can you make it so that units for a particular team spawn at a set time, or, more preferably following a certain action or event.
Re: Unit Kills and Spawning Q
Posted: Tue Jan 22, 2008 7:30 pm
by Teancum
This might not be what you'd like to hear, but you're trying to do to much hard stuff to early. Get to know the engine first, bro.
Re: Unit Kills and Spawning Q
Posted: Tue Jan 22, 2008 7:46 pm
by woner11
Does that mean it is possible?

Could you please explain? I really would like to know, but if you say so I will.

Re: Unit Kills and Spawning Q
Posted: Tue Jan 22, 2008 8:16 pm
by SBF_Dann_Boeing
if it's possible it'd require very complicated scripting. It'd be much simpler just to make a death region that if anything walked into it, would die, not necessarily trigger everyone elses death. I'd do what Teancum suggested.
Re: Unit Kills and Spawning Q
Posted: Tue Jan 22, 2008 8:31 pm
by woner11
Unfortunatly, I think it might be neccessary for one of my maps. I want it so when the ball is scored, a new team comes, and the old one is gone. Is there an easier solution?
Re: Unit Kills and Spawning Q
Posted: Tue Jan 22, 2008 8:40 pm
by [RDH]Zerted
Yes, both of those are possible. For killing players when a unit enters a region, you would want to use the OnEnterRegion callback, loop through all the units of a team, and use KillObject() on each one. The info you need to do this is in the scripting documentation and the listing of all the lua functions.
It is possible to force spawn units. However, doing so will prevent that player from picking a different unit class. There is no good way to keep people from being spawned. For that, you could place them in a room with no exit or just kill them again if they try to spawn too early, but both ways are not nice to the players.
Agreeing with Teancum, I think your map is going to be harder to build then you realise especially with your ideal quality in-mind. I'm not saying its not possible or that you can't do it, I know nothing about you, just don't expect it to be quick or easy.
(The code really isn't that complex. Its just not documented anywhere very well. The modding wiki...Arrgh)
Edit: Now you're getting into advanced scripting. You can fake a team change by manually controlling unit spawns. You will want to override ingame.lvl and bypass the unit selection screen. Each main team can have 9(?) possible units, meaning a total of 18 different teams (assuming everyone on the same team looks the same). Units would be automatically spawned as a certain soccer team. When that team looses, all those units would die and be respawned as the next team. Whatever side makes it through all 9 teams first looses?
Re: Unit Kills and Spawning Q
Posted: Tue Jan 22, 2008 9:06 pm
by Teancum
In other words, it's really to advanced. You gotta walk before you can run.
Re: Unit Kills and Spawning Q
Posted: Tue Jan 22, 2008 9:11 pm
by woner11
I agree Teancum. You were right. I guess I'll postpone that map.