Stygs 25 Posted September 14, 2015 (edited) 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 September 14, 2015 by Stygs Share this post Link to post
Lauren 78 Posted September 15, 2015 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
Madin 11 Posted September 16, 2015 (edited) 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 September 16, 2015 by Madin Share this post Link to post
Stygs 25 Posted September 16, 2015 Frankly, I have no idea what code Denato used. Share this post Link to post
Madin 11 Posted September 17, 2015 Frankly, I have no idea what code Denato used. The code was public for awhile. Share this post Link to post
Ravendark 46 Posted September 17, 2015 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
Stygs 25 Posted September 17, 2015 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
Egozi44 28 Posted September 18, 2015 (edited) 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 September 18, 2015 by Egozi44 Share this post Link to post
Lauren 78 Posted September 19, 2015 (edited) 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 September 19, 2015 by Lauren Share this post Link to post
Egozi44 28 Posted September 19, 2015 (edited) Oh I see Thanks for the info Edited September 19, 2015 by Egozi44 Share this post Link to post
Ravendark 46 Posted September 20, 2015 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
Stygs 25 Posted September 20, 2015 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
Madin 11 Posted September 21, 2015 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
Stygs 25 Posted September 21, 2015 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
Stygs 25 Posted September 22, 2015 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