Page 1 of 3
(FAQ) More ideas for heroes spawning troops (never give up!)
Posted: Tue Sep 12, 2006 11:01 pm
by jangoisbaddest
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)?
RE: More ideas for heroes spawning troops (never give up!)
Posted: Wed Sep 13, 2006 12:21 am
by [RDH]Zerted
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?
Posted: Wed Sep 13, 2006 3:23 pm
by Goblin014
You could make them like recon droids.... I dont know how to though, just an idea.

Posted: Wed Sep 13, 2006 3:48 pm
by Ace_Azzameen_5
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.
Posted: Wed Sep 13, 2006 4:07 pm
by Maveritchell
Ace_Azzameen_5 wrote:What about a two legged command walker using soldier animations and msh?
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.
Posted: Wed Sep 13, 2006 4:20 pm
by jangoisbaddest
[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.
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: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.
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:Isn't there already a topic talking about spawning troops from other troops? Why isn't this part of that?
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.
Maveritchell wrote:Ace_Azzameen_5 wrote:What about a two legged command walker using soldier animations and msh?
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.
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.
Posted: Wed Sep 13, 2006 4:30 pm
by Maveritchell
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.
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.
Posted: Wed Sep 13, 2006 4:42 pm
by Qdin
That's what XWingGuy calls Vehicle Mode!
OnCharacterSpawn I think, but Does it affect the player only, or everyone at that spawn as maveritchell said..?
Posted: Wed Sep 13, 2006 4:54 pm
by [RDH]Zerted
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:
Code: Select all
local unit = GetCharacterUnit( [player] )
SetProperty(unit, "[variable to change]", [new value] )
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.
Posted: Wed Sep 13, 2006 11:33 pm
by jangoisbaddest
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).
Posted: Thu Sep 14, 2006 10:01 am
by [RDH]Zerted
A beacon? I don't know what those are.
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)
Posted: Thu Sep 14, 2006 11:25 am
by RC-1290
beacons are used for airstrikes, as far as I know so that should work...
Posted: Thu Sep 14, 2006 12:05 pm
by PR-0927
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
Posted: Thu Sep 14, 2006 12:10 pm
by Maveritchell
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:
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
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.
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.
Posted: Thu Sep 14, 2006 5:41 pm
by 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)
Posted: Thu Sep 14, 2006 6:55 pm
by [RDH]Zerted
If a unit is spawn, it would act like any other spawned unit. Path nodes don't have sizes, they are just points in space.
Posted: Fri Sep 15, 2006 3:23 pm
by jangoisbaddest
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?
Posted: Fri Sep 15, 2006 4:09 pm
by 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?
Posted: Fri Sep 15, 2006 4:14 pm
by [RDH]Zerted
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.
Posted: Fri Sep 15, 2006 5:04 pm
by PR-0927
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