Posted: Mon Sep 21, 2015 8:17 am Post subject:
changing a unit during the game
Has anyone found out how to change a unit during a game via trigger?
Is it even possible to change a unit?
e.g.
The player starts with a Wolverine, moves on a certain cell, a Trigger fires and the Wolverine is replaced with a Titan.
How does the loaded Truck to unloaded Truck thing work? Is the truck a special hardcoded case?
Could this logic be applied to other units?
Can a train wagon for example switch from a loaded state to an unloaded state without disconnecting the train?
When a loaded Truck switches to an unloaded Truck, does only the image change or is the whole unit changed (different stats, weapon etc)?
Can this logic also work with InfantryTypes?
I think this has quite some potential for nice MP and SP missions, where a player starts for example with a special commando infantry, moves the unit on a cell with an overlay that looks like a weapon crate, and then the infantry changes into an alternate version with a different weapon. _________________ SHP Artist of Twisted Insurrection: Nod buildings
Posted: Mon Sep 21, 2015 9:04 am Post subject:
Re: changing a unit during the game
Lin Kuei Ominae wrote:
Has anyone found out how to change a unit during a game via trigger?
Is it even possible to change a unit?
e.g.
The player starts with a Wolverine, moves on a certain cell, a Trigger fires and the Wolverine is replaced with a Titan.
Yes it is, entirely scripted of course.
If the unit enters a cell, create a team of that unit on that cell (by WP for example).
Then use the script action to delete teammember, and spawn the Titan using the same trigger (like Action 80, or 7).
You can attach some heartbeat trigger to the Titan through its TeamType.
Just make sure you disable the proper triggers if it is a mission critical unit
Lin Kuei Ominae wrote:
How does the loaded Truck to unloaded Truck thing work? Is the truck a special hardcoded case?
Could this logic be applied to other units?
Yes. TRUCKA to TRUCKB and TRUCKB to TRUCKA. Entirely hardcoded.
Lin Kuei Ominae wrote:
Can a train wagon for example switch from a loaded state to an unloaded state without disconnecting the train?
IIRC there is an Action for a trigger that allows you to toggle the train cargo. It's 97; Toggles state of [Basic]→TrainCrate.
If you are referring to the logic of the Wolverine and Titan, I guess that's not gonna work as it requires the "Follows ID" field for a Unit.
Lin Kuei Ominae wrote:
When a loaded Truck switches to an unloaded Truck, does only the image change or is the whole unit changed (different stats, weapon etc)?
VehicleType [TRUCKA] changes to VehicleType [TRUCKB], they are two different units thus have their own stats.
Lin Kuei Ominae wrote:
Can this logic also work with InfantryTypes?
No experience with this, but I think it would work the same as the Wolverine example.
Lin Kuei Ominae wrote:
I think this has quite some potential for nice MP and SP missions, where a player starts for example with a special commando infantry, moves the unit on a cell with an overlay that looks like a weapon crate, and then the infantry changes into an alternate version with a different weapon.
Too bad the delete teammember, spawn new unit also resets the health. I was hoping there is a way to just switch the unit, but keep all the stats like health, veteran status, powerup crate bonus etc.
Especially for a commando mission it would have been nice if the assigned unit group number or the currently selected unit would stay assigned/selected.
I'll have to experiment a bit with this and the truck logic.
Though i guess the hardcoded TRUCKA to B change isn't enough for a missions needs, since there is no TRUCKC D etc. So the delete teammember spawn new unit way is the way to go. _________________ SHP Artist of Twisted Insurrection: Nod buildings
That's the idea. Though i would create a new infantry from scratch and not use the Renegade model. _________________ SHP Artist of Twisted Insurrection: Nod buildings
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum