(FAQ) More ideas for heroes spawning troops (never give up!)
Moderator: Moderators
- jangoisbaddest
- Lieutenant General

- Posts: 661
- Joined: Mon Feb 27, 2006 12:10 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: All Along The Watchtower
(FAQ) More ideas for heroes spawning troops (never give up!)
1) Can one create a spawn path ingame (NOT in ZeroEditor)? Like dispense one, or perhaps code one to appear at a location with a weapon?
2) Is there any way to teleport a unit already on the map?
3) Can one add the soldier animation to a droid or other object that one can dispense with pilottype = self (assuming I'm using a BattleDroid msh)?
2) Is there any way to teleport a unit already on the map?
3) Can one add the soldier animation to a droid or other object that one can dispense with pilottype = self (assuming I'm using a BattleDroid msh)?
- [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: More ideas for heroes spawning troops (never give up!)
1) I think so, but I know of no way to get a coordinate ingame. You would have to know the location that it is going to move it to, in which case it would just be easier to put one there in ZeroEdit.
2) Yes, I think there are two ways depending on what you mean by teleport and if you want the player to do it or the Lua to force the player to a different location.
3) It is possible to dynamically change a unit's skin ingame, but keep in mind that the head offset would be off, the death animations would be off, and I'm sure other things would be off unless you changed all those too. Of course, if this is some type of 'hologram' or object it wouldn't matter about those things being off. It only matters if you want to morf one unit into another.
Isn't there already a topic talking about spawning troops from other troops? Why isn't this part of that?
2) Yes, I think there are two ways depending on what you mean by teleport and if you want the player to do it or the Lua to force the player to a different location.
3) It is possible to dynamically change a unit's skin ingame, but keep in mind that the head offset would be off, the death animations would be off, and I'm sure other things would be off unless you changed all those too. Of course, if this is some type of 'hologram' or object it wouldn't matter about those things being off. It only matters if you want to morf one unit into another.
Isn't there already a topic talking about spawning troops from other troops? Why isn't this part of that?
-
Ace_Azzameen_5
- Jedi

- Posts: 1119
- Joined: Sat Apr 23, 2005 8:52 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
What about a two legged command walker using soldier animations?
And msh?
And then, the hero could just be a modded soldier with a different unit name, and maybe it could be lua scripted to teleport any of that unit beside the spawned hero wallker thing. Or even put them in it. The hero walker could be inside a msh awhere it is inaccesibble.
Or can you make it so that only certain units can spawn at a certain path, and exlude the hero unit from normal paths and exlude all other units from the hero walker area path?
Well, maybe this should be answered after someone makes a vehicle class using the soldier stuff.
And msh?
And then, the hero could just be a modded soldier with a different unit name, and maybe it could be lua scripted to teleport any of that unit beside the spawned hero wallker thing. Or even put them in it. The hero walker could be inside a msh awhere it is inaccesibble.
Or can you make it so that only certain units can spawn at a certain path, and exlude the hero unit from normal paths and exlude all other units from the hero walker area path?
Well, maybe this should be answered after someone makes a vehicle class using the soldier stuff.
- Maveritchell
- Jedi Admin

- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
The problem there is that you'd never be able to spawn as the command walker, so it would be unuseable by the player. You could enter it after having it spawn at a vehicle spawn, or you could have it self-piloted and look like a person spawning troops, though.Ace_Azzameen_5 wrote:What about a two legged command walker using soldier animations and msh?
- jangoisbaddest
- Lieutenant General

- Posts: 661
- Joined: Mon Feb 27, 2006 12:10 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: All Along The Watchtower
I would want the player to do it. Basically, I want the illusion that you're spawning troops, even though you're really just pulling them in from other areas of the map (with a special weapon).[RDH]Zerted wrote:2) Yes, I think there are two ways depending on what you mean by teleport and if you want the player to do it or the Lua to force the player to a different location.
The main problem is the soldier animation. I would just like to know if there's any way to incorporate that into, say, a self - pilotable droid.[RDH]Zerted wrote:3) It is possible to dynamically change a unit's skin ingame, but keep in mind that the head offset would be off, the death animations would be off, and I'm sure other things would be off unless you changed all those too. Of course, if this is some type of 'hologram' or object it wouldn't matter about those things being off. It only matters if you want to morf one unit into another.
If you're referring to my last ones, I didn't want to double - post. If you were not, then please tell me where to find it! I searched for one and couldn't find one.[RDH]Zerted wrote:Isn't there already a topic talking about spawning troops from other troops? Why isn't this part of that?
I'm not entirely sure, but I thought I read somewhere that it was possible to have the player spawn already inside a vehicle. Perhaps I'm wrong, but if not, then this might be the ticket.Maveritchell wrote:The problem there is that you'd never be able to spawn as the command walker, so it would be unuseable by the player. You could enter it after having it spawn at a vehicle spawn, or you could have it self-piloted and look like a person spawning troops, though.Ace_Azzameen_5 wrote:What about a two legged command walker using soldier animations and msh?
- Maveritchell
- Jedi Admin

- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
It's probably a fair bet that you read the bit about spawning in a vehicle in my thread about self-destructs. I found an old thread with PAN-Fnord in which he talked about it. The gist of the conversation was that you could force a unit into a vehicle whenever it spawned, but it would be any unit that spawned at a certain command post that would be forced in there.jangoisbaddest wrote:I'm not entirely sure, but I thought I read somewhere that it was possible to have the player spawn already inside a vehicle. Perhaps I'm wrong, but if not, then this might be the ticket.
-
Qdin
- Old School Staff
- Posts: 2059
- Joined: Wed Feb 23, 2005 9:54 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- [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:
You will need to spawn the players through the Lua. First, you need a pointer to the player that will be spawned. Somehow, this player needs to trigger an event (such as DispenseControllable or OnCharacterDeath)which you watch inorder to determine which players will be spawned. Second, you need a point to spawn the unit. This would be the location of your hero. Currently, it is unknown how to spawn something at a movable location ingame. Find a way, and this is possible.
I have never tried changing a unit's animations ingame. If it is possible, you may be able do it by messing around with:
Yes, it is supposed to be possible to force a unit into a vehicle as soon as that unit spawns. Many people have talked about it, but I've never seen someone try it.
I have never tried changing a unit's animations ingame. If it is possible, you may be able do it by messing around with:
Code: Select all
local unit = GetCharacterUnit( [player] )
SetProperty(unit, "[variable to change]", [new value] )- jangoisbaddest
- Lieutenant General

- Posts: 661
- Joined: Mon Feb 27, 2006 12:10 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: All Along The Watchtower
A beacon! Doesn't that provide coordinates? So the hero would lay a beacon, then I could use those coordinates to teleport friendly units already ingame, right? They would be random picks, as long as they are on your team. Or perhaps there's already a simpler way of getting the hero's location (like GetCharacterPosition or something).
- [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:
A beacon? I don't know what those are.
Here are some functions I found that may be of intrest
Here are some functions I found that may be of intrest
Code: Select all
SetMapCameraOffset(2, offset[1], offset[2], offset[3])
SetMapCameraPitch(0, -0.05)
SetMapCameraPosition(x, y, z)
SetMapCameraZoom(zoom)
local x, y, z = GetMapCameraPosition()
local x, y, z = GetWorldPosition(planet)
local x1, y1 = GetScreenPosition(planet)- PR-0927
- Old School Staff
- Posts: 844
- Joined: Fri Dec 31, 2004 9:15 pm
- Location: Kent, OH, U.S.A.
If someone knows of any way to get a vehicle to "spawn troops" as a weapon with ammo...kinda like dispensing soldiers with a team which are AI-controlled...please post here. There may be a thread about it, as Zerted seems to have stated above, but I seem to have missed it.
Basically, I'd like to enable MTTs to spawn B1 Battle Droids, either in mass amounts (like 4 at a time), or one by one, whichever the game can do.
Thanks.
- Majin Revan
Basically, I'd like to enable MTTs to spawn B1 Battle Droids, either in mass amounts (like 4 at a time), or one by one, whichever the game can do.
Thanks.
- Majin Revan
- Maveritchell
- Jedi Admin

- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
Here's what I found out about vehicles spawning, and possibly what Zerted was referring to:
Maveritchell, in another thread wrote:Ok, for sake of clarity, here's the answer to my own question:
Here's what PAN-Fnord had to say on the topic:
Unfortunately, for me, that means I cannot do what I want, as I can't have vehicles just sitting around waiting to have units spawned into them. The unit/vehicle I'm looking for is a four-legged droid, and short of modeling one and creating an entirely new skeleton and animation set - at which I would be woefully inept - I'm not sure that there's really a solution.PAN-Fnord and [RDH]Zerted wrote:
P-F: Well, you can't spawn as a vehicle per-se because it doesn't derive from the same things a soldier does. What you can do is in your mission script, when the player spawns, create a flyer (or grab one from somewhere), put it at his position, and force him into it. We were doing that as a test at one point, but that was scrapped - it works though.
Mike Z
...
R-Z: I've found OnCharacterEnterVehicle(), ForceAIOutOfVehicles(), and a few others, but nothing to force a unit to enter a vehicle. Is it done using SetProperty() or do you force the player to press the enter vehicle key when they are standing close to the vehicle?
...
P-F: It's just EnterVehicle(vehicle, playerNumber)
Where "vehicle" is either a reference to a vehicle or a string that is the name of a vehicle. For vehicle names, vehicles take the name of their vehicle-spawns, so if your vehicle spawn is "snazzy" even if it's spawning X-Wings, they're snazzy1, etc. Otherwise you can actually just create a vehicle using
CreateEntity(ODFname, optionalMatrix, optionalNameForVehicle)
So you can do EnterVehicle(CreateEntity("all_fly_snowspeeder"), 1) hopefully.
Mike Z
To anyone whose interest is truly piqued in helping me solve both these things - and their possible ramifications, I would provide further detail as to why I want these things through a PM.
Of course, I welcome further discussion, especially of the self-destruct problem, in this thread.
-
somen00b
Quick relevant question? if a unit is spawned from a weapon onto a pathnode, would it act normally? If so could you make a giant path node that would cover all the areas not covered by the regular path nodes so you would be in essence, spawning onto a pathnode.
(this isn't my kind of modding so this might look newbish, I almost never use ZE, I do better with ODFs)
(this isn't my kind of modding so this might look newbish, I almost never use ZE, I do better with ODFs)
- [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:
- jangoisbaddest
- Lieutenant General

- Posts: 661
- Joined: Mon Feb 27, 2006 12:10 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: All Along The Watchtower
Okay, my experiments in different areas have failed, but I will share what exactly happened and try to provide some groundwork for developing some kind of system for troop - spawning.
1) I took a recon droid's ODF and changed a few things - mainly I added the stats of your basic Battledroid (stand, crouch positions, max sprinting speeds, etc.), added in the battledroid's animation refrence, changed the msh to that of the battle droid, and finally set pilottype = "self". What resulted was a pile of Battle Droid parts when I dispensed one - it was still an object, but it just sat there, in a pile of droid parts. I could even destroy it with the right explosion and everything, and it appeared as a friendly to me (and even an enemy when I left it there and spawned as the other team). I suspect it has something to do with the animations.
2) I tried to just spawn a plain - ol droid marine. He had the right stance, weapons, and everything - he was even bobbing slightly (like units do when they stand still). However, he did not move at all unless I bumped him in a direction (in which he used the right animations and everything). Again, he showed up as a friendly, and an enemy when I left him there and spawned as the other team. This, however, must be because there is no "conciousness" that is in control of it - that is, he's not a bot, he's just a unit which no one has control over. This is further supported by the fact that even enemy BOTS in range of him would ignore him (not try to kill him). So all that needs to be done here is to make it so that somehow, the droid is assigned a bot (which there may not be a way to do that other than spawning at a path node).
3) The whole "trying to make the hero a commandwalker" test crashed the map with no explanation.
I have another idea, and Zerted would probably be able to asses its feasability - what about creating an object like the command posts that can be destroyed (ex. Techno - Union ships)? Can one dispense that, and set a lifespan on it so that it destroyes itself after a while? Or perhaps give coordinates which can then be used to place a spawn path there temporarily?
1) I took a recon droid's ODF and changed a few things - mainly I added the stats of your basic Battledroid (stand, crouch positions, max sprinting speeds, etc.), added in the battledroid's animation refrence, changed the msh to that of the battle droid, and finally set pilottype = "self". What resulted was a pile of Battle Droid parts when I dispensed one - it was still an object, but it just sat there, in a pile of droid parts. I could even destroy it with the right explosion and everything, and it appeared as a friendly to me (and even an enemy when I left it there and spawned as the other team). I suspect it has something to do with the animations.
2) I tried to just spawn a plain - ol droid marine. He had the right stance, weapons, and everything - he was even bobbing slightly (like units do when they stand still). However, he did not move at all unless I bumped him in a direction (in which he used the right animations and everything). Again, he showed up as a friendly, and an enemy when I left him there and spawned as the other team. This, however, must be because there is no "conciousness" that is in control of it - that is, he's not a bot, he's just a unit which no one has control over. This is further supported by the fact that even enemy BOTS in range of him would ignore him (not try to kill him). So all that needs to be done here is to make it so that somehow, the droid is assigned a bot (which there may not be a way to do that other than spawning at a path node).
3) The whole "trying to make the hero a commandwalker" test crashed the map with no explanation.
I have another idea, and Zerted would probably be able to asses its feasability - what about creating an object like the command posts that can be destroyed (ex. Techno - Union ships)? Can one dispense that, and set a lifespan on it so that it destroyes itself after a while? Or perhaps give coordinates which can then be used to place a spawn path there temporarily?
-
darthpingu
It could die after 5 secs, and belong to team 3, which is the guy you wanna spawn, and make it so team 3 only has 1 unit count. Then wouldn't it spawn instantly, or at least within 5 seconds? But one problem is it's got to be in the lua, and you could only dispense one at a time. But if you made it like a commandwalker(quote), it could "come and go". Get it?
Last edited by darthpingu on Fri Sep 15, 2006 4:19 pm, edited 1 time in total.
- [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:
I only know how to spawn units onto a path node. If a Techni-Union ship gives you a path node when its created, then it would work. The Union ship would show up on the map as a selectable CP, so in that sence it would work, but you couldn't force units to spawn there through the Lua. I don't know how to get coordinates from inside the game.
Bots do move unless they have an AI goal. They will stop exactly where they are if their goals are removed, even in mid run with legs apart.
Bots do move unless they have an AI goal. They will stop exactly where they are if their goals are removed, even in mid run with legs apart.
- PR-0927
- Old School Staff
- Posts: 844
- Joined: Fri Dec 31, 2004 9:15 pm
- Location: Kent, OH, U.S.A.
So no information about spawning soldiers from an MTT besides what jangoisbaddest posted? I'd really like for this to be possible.
Having a "CommandWalker" soldier would be insane. Do you reckon that there might be a "CommandSoldier" line or something? Oh, did you change that hero's .odf file to make it a walker rather then a soldier? If not, it would not work.
Oh, this is off-topic, but Zerted, do you have Xfire or MSN? I'd like to add you to my list of modders, if you don't mind.
- Majin Revan
Having a "CommandWalker" soldier would be insane. Do you reckon that there might be a "CommandSoldier" line or something? Oh, did you change that hero's .odf file to make it a walker rather then a soldier? If not, it would not work.
Oh, this is off-topic, but Zerted, do you have Xfire or MSN? I'd like to add you to my list of modders, if you don't mind.
- Majin Revan
