Author |
Message |
ryry1237
Joined: Sun Dec 25, 2011 7:23 am Posts: 269
|
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?
|
Wed Feb 01, 2012 1:55 am |
|
|
ryry1237
Joined: Sun Dec 25, 2011 7:23 am Posts: 269
|
Re: Any way to reset gibwoundlimit?
What about limbs and stuff?
Last edited by ryry1237 on Wed Feb 01, 2012 3:18 am, edited 3 times in total.
|
Wed Feb 01, 2012 3:05 am |
|
|
ryry1237
Joined: Sun Dec 25, 2011 7:23 am Posts: 269
|
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.
Last edited by ryry1237 on Wed Feb 01, 2012 3:20 am, edited 1 time in total.
|
Wed Feb 01, 2012 3:17 am |
|
|
ryry1237
Joined: Sun Dec 25, 2011 7:23 am Posts: 269
|
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.
Last edited by ryry1237 on Wed Feb 01, 2012 4:03 am, edited 1 time in total.
|
Wed Feb 01, 2012 3:22 am |
|
|
Asklar
Data Realms Elite
Joined: Fri Jan 07, 2011 8:01 am Posts: 6211 Location: In your office, earning your salary.
|
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.
|
Wed Feb 01, 2012 5:01 am |
|
|
Duh102
happy carebear mom
Joined: Tue Mar 04, 2008 1:40 am Posts: 7096 Location: b8bbd5
|
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.
|
Wed Feb 01, 2012 5:30 am |
|
|
ryry1237
Joined: Sun Dec 25, 2011 7:23 am Posts: 269
|
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?
|
Wed Feb 01, 2012 6:41 am |
|
|
Asklar
Data Realms Elite
Joined: Fri Jan 07, 2011 8:01 am Posts: 6211 Location: In your office, earning your salary.
|
Re: Any way to reset gibwoundlimit?
|
Wed Feb 01, 2012 6:54 am |
|
|
weegee
DRL Developer
Joined: Thu Jun 11, 2009 2:34 pm Posts: 966 Location: Moscow, Russia
|
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.
|
Wed Feb 01, 2012 7:08 am |
|
|
ryry1237
Joined: Sun Dec 25, 2011 7:23 am Posts: 269
|
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?
|
Fri Feb 03, 2012 4:32 am |
|
|
Zaggy1024
Joined: Sun Jan 22, 2012 6:39 am Posts: 12
|
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
|
Fri Feb 03, 2012 6:59 am |
|
|
Gotcha!
Joined: Tue Apr 01, 2008 4:49 pm Posts: 1972 Location: The Netherlands
|
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
|
Fri Feb 03, 2012 1:07 pm |
|
|
Xery
Joined: Sat Feb 26, 2011 10:29 am Posts: 163
|
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)?
|
Fri Feb 17, 2012 5:33 pm |
|
|
Roast Veg
Data Realms Elite
Joined: Tue May 25, 2010 8:27 pm Posts: 4521 Location: Constant motion
|
Re: Any way to reset gibwoundlimit?
I don't think those are in progress, no.
|
Fri Feb 17, 2012 6:28 pm |
|
|
Asklar
Data Realms Elite
Joined: Fri Jan 07, 2011 8:01 am Posts: 6211 Location: In your office, earning your salary.
|
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.
|
Sun Feb 19, 2012 4:17 am |
|
|
|