Author |
Message |
franky1223
Joined: Mon Jun 21, 2010 3:37 pm Posts: 7
|
Invincible = Lua?
Hello everyone, I just wanted to know if I can make an actor invincible (not just hard to kill, bullets are bouncing and impacts do nothing). Even if it needs lua, could someone explain me how to do?
|
Sun Aug 08, 2010 11:08 pm |
|
|
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
Re: Invincible = Lua?
It's pretty much impossible to make an actor 100% invincible. Recursive gibbing is one way you can get an actor to "respawn" instantly when it dies, making it difficult to get rid of.
|
Sun Aug 08, 2010 11:59 pm |
|
|
franky1223
Joined: Mon Jun 21, 2010 3:37 pm Posts: 7
|
Re: Invincible = Lua?
If we get rid of the impact resistance, is it possible to make it... 99% invincible (without recursive gibbing please)?
|
Mon Aug 09, 2010 12:16 am |
|
|
Grif
REAL AMERICAN HERO
Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
|
Re: Invincible = Lua?
You can do roughly 80% invincible through plain .ini means.
|
Mon Aug 09, 2010 1:08 am |
|
|
mail2345
Joined: Tue Nov 06, 2007 6:58 am Posts: 2054
|
Re: Invincible = Lua?
And this should take care of a good deal more: Code: function Update(self) self.Health = 100 --Incase some lua prevents regen if not SceneMan:IsWithinBounds(self.Pos, 0) then --Falling off the map self.Vel = Vector(-self.Vel.X,-self.Vel.Y) end if self.Vel.Magnitude > 100 then --Absurd velocities are bad self.Vel = Vector(0,0) end if self:GetController().InputMode ~= 1 or self:GetController().InputMode ~= 2 then --Prevent paralsys self:GetController().InputMode = 1 end self.ToDelete = false self.Lifetime = 99999 self.Age = 0 self.Status = 0 end That takes care of several things that inis can't block. However, Lua can still mess it up(GibThis for an example, but recursive gibbing takes care of that. Outright deleting the actor instead of setting it to delete can't be blocked, IIRC).
|
Mon Aug 09, 2010 1:13 am |
|
|
PhantomAGN
Joined: Mon Jun 29, 2009 2:40 am Posts: 610 Location: Deep below The Map of Mars
|
Re: Invincible = Lua?
The actor could spawn a watchman particle which tracks the actor's position, and if the actor is ever removed from the map just replaces it. That ought to solve the plain delete.
|
Mon Aug 09, 2010 1:56 am |
|
|
TheLastBanana
DRL Developer
Joined: Wed Dec 13, 2006 5:27 am Posts: 3138 Location: A little south and a lot west of Moscow
|
Re: Invincible = Lua?
Outright deleting usually causes the game to crash anyway.
|
Mon Aug 09, 2010 2:09 am |
|
|
franky1223
Joined: Mon Jun 21, 2010 3:37 pm Posts: 7
|
Re: Invincible = Lua?
Lua code doesn't work. I spawned my uberinvinciblemegarobotthatkicksass in bunker creation phase and it seemed working, then i spawned another one after the game started and it crashed. Also, I would have tried recursive gibbing, but I don't know how to do that.
|
Mon Aug 09, 2010 5:53 am |
|
|
Grif
REAL AMERICAN HERO
Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
|
Re: Invincible = Lua?
Lua code virtually never crashes the game, though.
|
Mon Aug 09, 2010 6:03 am |
|
|
franky1223
Joined: Mon Jun 21, 2010 3:37 pm Posts: 7
|
Re: Invincible = Lua?
It could've been anything else...
|
Mon Aug 09, 2010 6:07 am |
|
|
mail2345
Joined: Tue Nov 06, 2007 6:58 am Posts: 2054
|
Re: Invincible = Lua?
I honestly don't see anything that SHOULD be affected by the presence of another. Phantom: Forgot that. I was about to ask about the inventory, but then I remembered that inventory cloning is possible.
|
Mon Aug 09, 2010 9:25 am |
|
|
zalo
Joined: Sat Feb 03, 2007 7:11 pm Posts: 1496
|
Re: Invincible = Lua?
Also, on older builds it would dissapear when pushed into the terrain far enough. I don't know if it still does this, but it would be wise to have a terrain check (or recursive gibbing).
|
Mon Aug 09, 2010 9:41 pm |
|
|
|