Data Realms Fan Forums http://45.55.195.193/ |
|
Any way to reset gibwoundlimit? http://45.55.195.193/viewtopic.php?f=73&t=29796 |
Page 1 of 2 |
Author: | ryry1237 [ Wed Feb 01, 2012 1:55 am ] |
Post subject: | Any way to reset gibwoundlimit? |
One of the main problems with regeneration effects is that they don't address the number of shots that an actor has taken. An actor with a gibwoundlimit of 20 who just received 19 shots will die on the next shot regardless of whether his health is "healed" or not. So I'd just like to ask, is there any way to reset the number of wounds an actor has taken or any way to gradually increase an actor's gibwoundlimit over time via lua? |
Author: | ryry1237 [ Wed Feb 01, 2012 3:05 am ] |
Post subject: | Re: Any way to reset gibwoundlimit? |
What about limbs and stuff? |
Author: | ryry1237 [ Wed Feb 01, 2012 3:17 am ] | ||
Post subject: | Re: Any way to reset gibwoundlimit? | ||
Sorry Nonsequitorian, but after running a test, shooting a full health actor who is just one shot away from his gibwoundlimit will still kill him. Me shooting the 20th bullet into a full health actor.
|
Author: | ryry1237 [ Wed Feb 01, 2012 3:22 am ] |
Post subject: | Re: Any way to reset gibwoundlimit? |
I have no idea how to do that with lua though. edit: Simply slapping this code on a wound doesn't work Code: function Create(self) self.LifeTimer = Timer(); end function Update(self) if self.LifeTimer:IsPastSimMS(1000) then self.ToDelete = true end end edit2: nothing's wrong with the code itself (i think) since if you slap it on a bullet and lower the IsPastSimMS(1000) to something much lower, the bullet disappears in mid air a lot earlier. It just doesn't work with emitters for some reason. |
Author: | Asklar [ Wed Feb 01, 2012 5:01 am ] |
Post subject: | Re: Any way to reset gibwoundlimit? |
Probably those work deleting the actor and spawning the same one with a copy of the inventory, because as far as I know, you can't acces actors' wounds. I'd thought of accesing them using the classical scripts for determining a certain attachable in the actor, but I don't know if wounds count as a MO or even as an attachable. I haven't tried it though, so maybe it works. Now, another interesting thing would be knowing if self.GibWoundLimit is a read-only property or not. |
Author: | Duh102 [ Wed Feb 01, 2012 5:30 am ] |
Post subject: | Re: Any way to reset gibwoundlimit? |
It's a readonly property, pretty sure. As of now, the only way to get rid of wounds is to make a new actor, transfer the old actor's inventory to it, and then replace the old actor with the new actor, clearing all the wounds in the process. At least, last time I checked. |
Author: | ryry1237 [ Wed Feb 01, 2012 6:41 am ] |
Post subject: | Re: Any way to reset gibwoundlimit? |
Weegee's Amazing Medikit Code: function Create(self) -- Heal every human within 200 pixels. local curdist = 200; for actor in MovableMan.Actors do local avgx = actor.Pos.X - self.Pos.X; local avgy = actor.Pos.Y - self.Pos.Y; local dist = math.sqrt(avgx ^ 2 + avgy ^ 2); if dist < curdist and actor.ClassName == "AHuman" then actor.Health = 100; actor:FlashWhite(250); end end end Does nothing for gibwoundlimit. How would I go about writing the script for making a new actor without Cortex Shock's convenient room transferring scene? |
Author: | Asklar [ Wed Feb 01, 2012 6:54 am ] |
Post subject: | Re: Any way to reset gibwoundlimit? |
It'd be like this. |
Author: | weegee [ Wed Feb 01, 2012 7:08 am ] |
Post subject: | Re: Any way to reset gibwoundlimit? |
Just rip GetInventory(actor) from CortexShock.lua, get actor inventory with it, remove old actor, spawn new one and give everything back. Function returns a list of items presetnames and a list of items classes and works pretty fine. Just be careful with if actor.Team == CF_CPUTeam line you might have to change it. |
Author: | ryry1237 [ Fri Feb 03, 2012 4:32 am ] |
Post subject: | Re: Any way to reset gibwoundlimit? |
weegee's save player inventory code Code: -- Save player actors inventories for a = 1, CF_MaxPlayerActors do if self.PlayerActors[a] ~= nil and MovableMan:IsActor(self.PlayerActors[a]) then local inventory, classes = self:GetInventory(self.PlayerActors[a]); -- print (#inventory) if inventory ~= nil and #inventory > 0 then for i = 1, #inventory do config["PlayerActor"..tostring(a).."Inventory"..tostring(i).."Preset"] = inventory[i]; config["PlayerActor"..tostring(a).."Inventory"..tostring(i).."Class"] = classes[i]; end end end end I can kinda understand this... but then again I kinda don't I was originally thinking of adding this line to copy inventory items over. Code: self.regeneffect:AddInventoryItem(*original actor's inventory*); But I don't know the code for *original actor's inventory* Also, how should I go about keeping the same AIMode? |
Author: | Zaggy1024 [ Fri Feb 03, 2012 6:59 am ] |
Post subject: | Re: Any way to reset gibwoundlimit? |
ryry1237 wrote: Code: -- Save player actors inventories for a = 1, CF_MaxPlayerActors do if self.PlayerActors[a] ~= nil and MovableMan:IsActor(self.PlayerActors[a]) then local inventory, classes = self:GetInventory(self.PlayerActors[a]); -- print (#inventory) if inventory ~= nil and #inventory > 0 then for i = 1, #inventory do config["PlayerActor"..tostring(a).."Inventory"..tostring(i).."Preset"] = inventory[i]; config["PlayerActor"..tostring(a).."Inventory"..tostring(i).."Class"] = classes[i]; end end end end I can kinda understand this... but then again I kinda don't I was originally thinking of adding this line to copy inventory items over. Code: self.regeneffect:AddInventoryItem(*original actor's inventory*); But I don't know the code for *original actor's inventory* I expect what you would want to do is put that line inside the "for i = 1, #inventory do" loop, and make the parameter of AddInventoryItem be "inventory[i]". I don't know, but you may need to use something like "ToHDFirearm(inventory[i])" instead, though you probably shouldn't need to. ryry1237 wrote: Also, how should I go about keeping the same AIMode? I'm not sure if the AIMode property is read-only, but if it isn't, then something like this should work, assuming you made "self.regeneffect" as type Actor. Code: self.regeneffect.AIMode = self.AIMode |
Author: | Gotcha! [ Fri Feb 03, 2012 1:07 pm ] |
Post subject: | Re: Any way to reset gibwoundlimit? |
CaveCricket made a nice medikit pack where one of the medikits fully 'heals' your actor by removing the actor and spawning the same one, complete with its previous inventory. (Using it on a brain makes you instantly lose though, due to the brain briefly being removed, leaving the player without a brain unit.) Edit: viewtopic.php?f=61&t=17606 |
Author: | Xery [ Fri Feb 17, 2012 5:33 pm ] |
Post subject: | Re: Any way to reset gibwoundlimit? |
So, will there be any new functions coming with the new version game, allow modders to edit MOs' wound-counter? Also, will there be any value for non-vanilla mod actors to be judged as machine(can be hurt by EMP) or flesh-built(can be hurt when nearby fire)? |
Author: | Roast Veg [ Fri Feb 17, 2012 6:28 pm ] |
Post subject: | Re: Any way to reset gibwoundlimit? |
I don't think those are in progress, no. |
Author: | Asklar [ Sun Feb 19, 2012 4:17 am ] |
Post subject: | Re: Any way to reset gibwoundlimit? |
Xery wrote: Also, will there be any value for non-vanilla mod actors to be judged as machine(can be hurt by EMP) or flesh-built(can be hurt when nearby fire)? I think that there should be an ARobot class apart from the AHuman. |
Page 1 of 2 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |