Behold the Yuuzhan Vong Army! This mod adds the Yuuzhan Vong Race as a playable faction and all units of this era. We are a community of modders working for the greater goal, so anyone who wants to help or support us is welcome!

Forum Thread
  Posts  
Switching out units VIA Story Scripting. (Games : Star Wars: Empire at War: Forces of Corruption : Mods : Yuuzhan Vong at War : Forum : MODDING HELP : Switching out units VIA Story Scripting.) Locked
Thread Options
Feb 6 2017 Anchor

I was making multiple variations of Red Squadron and was wondering if it was possible to have them automatically switch variants when one dies via story scripting. I was planning on going Red Squadron (Scarif) --> Red Squadron (Yavin) --> Rogue Squadron. I have enabled Hero Perma-Death so I wouldn't think I would need to remove the dead variations with the script. Here's what I've got so far, I have no idea if it'll work. I used Thrawn's Revenge's tech switching code as a base. Any help would be appreciated.

        <Event Name="Red_Squadron_Switch_1">
  		<Event_Type>STORY_TACTICAL_DESTROY</Event_Type>
  		<Event_Param1>Red_Squadron_Scarif_Space</Event_Param1>
		<Event_Param2>Empire, Pirates, Underworld, Hutts</Event_Param2>
 		<Reward_Type>SPAWN_HERO</Reward_Type>
  		<Reward_Param1>Rebel</Reward_Param1>
		<Reward_Param2>Red_Squadron_Space</Reward_Param2>
		<Reward_Param3>Yavin</Reward_Param3>
	</Event>

	<Event Name="Red_Squadron_Switch_2">
  		<Event_Type>STORY_TACTICAL_DESTROY</Event_Type>
  		<Event_Param1>Red_Squadron_Space</Event_Param1>
		<Event_Param2>Empire, Pirates, Underworld, Hutts</Event_Param2>
 		<Reward_Type>SPAWN_HERO</Reward_Type>
  		<Reward_Param1>Rebel</Reward_Param1>
		<Reward_Param2>Rogue_Squadron_Space</Reward_Param2>
		<Reward_Param3>Hoth</Reward_Param3>
	</Event>
Feb 7 2017 Anchor

I saw a tutorial for this just the other day but can't find it again. You're looking in the right place. If I find the one I was looking at before I'll let you know since it covered changing out an x-wing squadron for a more advanced model which would be perfect for you but here's a longer one that should help:

Moddb.com

Feb 8 2017 Anchor

Assuming that your units are coded as heroes you might find this tag more effective

STORY_DEFEAT_HERO

(Hero name)

Triggers when the specified hero is defeated in combat.

The other tag you might want to consider is this tag

STORY_DESTROY

(Object name)

(System name)

(number to destroy)

(who does the destroying)

(filter)

Triggers when a specified object or objects are destroyed in galactic mode. If you want to trigger via destruction in a tactical combat, use STORY_ TACTICAL_DESTROY instead.


I believe that the STORY_TACTICAL_DESTROY only works during a battle. So a death during GC would not be counted

Reply to thread
click to sign in and post

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.