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.
Unit Kills and Spawning Q
Moderator: Moderators
-
woner11
- Sith

- Posts: 1361
- Joined: Tue Sep 18, 2007 10:17 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: The lost world of pickels
- Contact:
- Teancum
- Jedi Admin

- Posts: 11080
- Joined: Wed Sep 07, 2005 11:42 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Indiana
Re: Unit Kills and Spawning Q
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.
-
woner11
- Sith

- Posts: 1361
- Joined: Tue Sep 18, 2007 10:17 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: The lost world of pickels
- Contact:
Re: Unit Kills and Spawning Q
Does that mean it is possible?
Could you please explain? I really would like to know, but if you say so I will. 
- SBF_Dann_Boeing
- Groove Walrus

- Posts: 1529
- Joined: Wed Aug 31, 2005 11:33 pm
- xbox live or psn: No gamertag set
- Location: An Igloo High Upon a Mountain Top
Re: Unit Kills and Spawning Q
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.
-
woner11
- Sith

- Posts: 1361
- Joined: Tue Sep 18, 2007 10:17 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: The lost world of pickels
- Contact:
Re: Unit Kills and Spawning Q
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?
- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
Re: Unit Kills and Spawning Q
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?
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?
- Teancum
- Jedi Admin

- Posts: 11080
- Joined: Wed Sep 07, 2005 11:42 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Indiana
Re: Unit Kills and Spawning Q
In other words, it's really to advanced. You gotta walk before you can run.
-
woner11
- Sith

- Posts: 1361
- Joined: Tue Sep 18, 2007 10:17 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: The lost world of pickels
- Contact:
Re: Unit Kills and Spawning Q
I agree Teancum. You were right. I guess I'll postpone that map.
