Jump to content
Sign in to follow this  
Stygs

Bug with TWA Epics and Cover

Recommended Posts

I recently tried to fix an old bug with the Epic units in TWA, but no matter what I try, i cant get rid of it. Maybe someone else has an idea:

 

Basicly, when you use the "Absorb infantry" abillity from the TWA epics, it triggers a couple of LUA script that determine the target and what upgrade the Epic should get. Works pretty reliable so far.

After that the infantry squad executes a LUA script to remove itself from the game [ExecuteAction("NAMED_DELETE", self)].

And this is where the problems start: If any member of the target squad is taking cover near a building, they will not be removed with the rest of the squad. Instead, it will stay at its position for ever (even if you sell the builiding). They can also be selected, but ignore every command.

 

So, basicly I am looking for ideas to either remove the Cover state somehow when using the "Absorb Infantry" abillity or reliable kill/remove the remaing soldiers.

My latest idea was to prevent the special abillity from targeting units in cover, but that didnt work very well since you can still target the squad member that are not taking cover.

 

Any suggestions?

Edited by Stygs

Share this post


Link to post

Instead of just deleting the squad try ObjectDoSpecialPower(squad, "DeleteMeemersDispatchSpecialPower") whcich triggers a dispatch sp to the squad members which triggers a weapon fire special power, which fires a weapon that has a LuaEventNugget, which triggers a script that deletes the unit.

Dunno if it works though.

Share this post


Link to post

I recently tried to fix an old bug with the Epic units in TWA, but no matter what I try, i cant get rid of it. Maybe someone else has an idea:

 

Basicly, when you use the "Absorb infantry" abillity from the TWA epics, it triggers a couple of LUA script that determine the target and what upgrade the Epic should get. Works pretty reliable so far.

After that the infantry squad executes a LUA script to remove itself from the game [ExecuteAction("NAMED_DELETE", self)].

And this is where the problems start: If any member of the target squad is taking cover near a building, they will not be removed with the rest of the squad. Instead, it will stay at its position for ever (even if you sell the builiding). They can also be selected, but ignore every command.

 

So, basicly I am looking for ideas to either remove the Cover state somehow when using the "Absorb Infantry" abillity or reliable kill/remove the remaing soldiers.

My latest idea was to prevent the special abillity from targeting units in cover, but that didnt work very well since you can still target the squad member that are not taking cover.

 

Any suggestions?

Refine the Denato method (ie improve the code).

 

For whatever the perceived complexities of the code, it does work without the issues you stated.

Edited by Madin

Share this post


Link to post

Frankly, I have no idea what code Denato used.

Share this post


Link to post

Frankly, I have no idea what code Denato used.

The code was public for awhile.

Share this post


Link to post

Not sure if this works but the hordecontain module inherits from the transportcontain and on its turn it inherits from opencontain. You might be able to use KillPassengersOnDeath (from the opencontain) to forcekill all the members of the squad container....altho this is a longshot and im not sure if it works for the hordecontain module (basic inheritence rules should make it work tho).

 

The problem is that the squad serves as a link towards the member objects. Removing the squad doesnt really mean you remove the members withit, the other way arround seems to work tho, if the squad has 0 surviving members it auto removes itself. In your case it seems like you remove the squad and by doing so you break the link to sertain members(those in cover) , by cutting the puppeteers strings you find that you can't control the remaning puppets.

 

Maybe a other way would be to not give the squad a kill command with lua but trigger a specialpower on itself that does replace self special power into a dummy that dies, or and this might be really extensive...give the squad a foxhole like command that shows a digin/getabsorbed animation then they enter a fake dummy invisible foxhole, and that foxhole object has a lifetime update into a no FX diemux.

Share this post


Link to post

The code was public for awhile.

 

 

Yeah, but I cant find it, so no idea how he did it.

 

 

@ Lauren & Ravendark

 

Triggering an upgrade/ability within the soldiers seem to be the best bet for it, havent tried it so far. I give it a try when I got a bit more time.

Share this post


Link to post

Question... (I may sound like a idiot due to my lack in TW modding) Can't you use the normal KW way to contain the inf as upgrades? or no one was able to add the code to TW and that why you/someone else made

the Absorb infantry ability?

 

In KW you can add to the Epic units new fxs without that ability

 

http://www.moddb.com/mods/kanes-wrath-unofficial-patch-104/images/redeemers-charged-particle-beam#imagebox

 

 

http://www.moddb.com/mods/kanes-wrath-unofficial-patch-104/images/supercharged-beam-turrets#imagebox

 

 

http://www.moddb.com/mods/kanes-wrath-unofficial-patch-104/images/icon#imagebox

Edited by Egozi44

Share this post


Link to post

The slaughter horde contain in KW was modified to grant upgrades. Without that you have to use quite an elusive workaround. (You can use the slaughter horde contain in combination with LUA to grant upgrades, but the "seat" will be open again, thus you can throw an unlimited amount of units into your epic if you do it that way, and replace self is always annoying.)

Edited by Lauren

Share this post


Link to post

Oh I see

 

Thanks for the info

Edited by Egozi44

Share this post


Link to post

didnt madin post the donato code thing in a another post involving his scrin hexapod? It basicly uses the Rider_ condition + a specialpower triggered upgrade to determin wich turret is visible on the hexapod? IIRC

Share this post


Link to post

Pretty sure it was only a small part of the code as I cant remember seeing anything that actually explaind what happend to the targeted infantry.

Share this post


Link to post

Pretty sure it was only a small part of the code as I cant remember seeing anything that actually explained what happened to the targeted infantry.

Have you checked your CNCZ private messages?

Share this post


Link to post

Wow, cant belive I didnt notice the message >_>

 

Thank you very much, now I just have to figure what parts of it I need and how it works :)

Share this post


Link to post

Instead of just deleting the squad try ObjectDoSpecialPower(squad, "DeleteMeemersDispatchSpecialPower") whcich triggers a dispatch sp to the squad members which triggers a weapon fire special power, which fires a weapon that has a LuaEventNugget, which triggers a script that deletes the unit.

Dunno if it works though.

Works, but has a some drawbacks:

The soldiers in cover disappear a bit later than the rest and if they are currently running into cover, they are finishing their movement before dissapearing. Also, I still need to delete the squad object or I end up with a squad without any soldiers (kinda weird thing to happen).

 

Not sure if this works but the hordecontain module inherits from the transportcontain and on its turn it inherits from opencontain. You might be able to use KillPassengersOnDeath (from the opencontain) to forcekill all the members of the squad container....altho this is a longshot and im not sure if it works for the hordecontain module (basic inheritence rules should make it work tho).

 

Could work, but since I dont know what else could be affected, I dindt try it.

 

Maybe a other way would be to not give the squad a kill command with lua but trigger a specialpower on itself that does replace self special power into a dummy that dies, or and this might be really extensive...give the squad a foxhole like command that shows a digin/getabsorbed animation then they enter a fake dummy invisible foxhole, and that foxhole object has a lifetime update into a no FX diemux.

 

Thats basicly the solution DetoNato used in his mod - the infantry grants an upgrade to the MARV and then use a ChainedCommand to replace themself with a dummy.

And while I dont like to add another CommandButton for all Squads, the ReplaceSelf method works suprisingly well so far and requires only minor changes to my existing code (ie another module in the BaseObject and a couple more lines in the LUA scripts).

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×