View unanswered posts | View active topics It is currently Tue Apr 23, 2024 9:25 pm



Reply to topic  [ 12 posts ] 
 Invincible = Lua? 
Author Message

Joined: Mon Jun 21, 2010 3:37 pm
Posts: 7
Reply with quote
Post 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
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13143
Location: Here
Reply with quote
Post 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
Profile

Joined: Mon Jun 21, 2010 3:37 pm
Posts: 7
Reply with quote
Post 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
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Invincible = Lua?
You can do roughly 80% invincible through plain .ini means.


Mon Aug 09, 2010 1:08 am
Profile
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post 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
Profile
User avatar

Joined: Mon Jun 29, 2009 2:40 am
Posts: 610
Location: Deep below The Map of Mars
Reply with quote
Post 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
Profile
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3138
Location: A little south and a lot west of Moscow
Reply with quote
Post Re: Invincible = Lua?
Outright deleting usually causes the game to crash anyway.


Mon Aug 09, 2010 2:09 am
Profile WWW

Joined: Mon Jun 21, 2010 3:37 pm
Posts: 7
Reply with quote
Post 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
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Invincible = Lua?
Lua code virtually never crashes the game, though.


Mon Aug 09, 2010 6:03 am
Profile

Joined: Mon Jun 21, 2010 3:37 pm
Posts: 7
Reply with quote
Post Re: Invincible = Lua?
It could've been anything else...


Mon Aug 09, 2010 6:07 am
Profile
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post 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
Profile

Joined: Sat Feb 03, 2007 7:11 pm
Posts: 1496
Reply with quote
Post 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
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 12 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.055s | 15 Queries | GZIP : Off ]