Author |
Message |
numgun
Joined: Sat Jan 13, 2007 11:04 pm Posts: 2932
|
Is this possible?
I've had this ridiculous idea for a long time in my head and I thought of asking if its possible to do with Lua since I'm quite certain its not possible through normal ini hacks.
Neck Snap.
Basically makes the opposing actor's head make a nice HFlipped = 1 while the rest of his body stays still. Or if not that, then atleast detach the head, and then flip it. In the process the victim recieves -100 hp and gives a nice *crack* sound.
|
Tue Sep 08, 2009 6:34 pm |
|
|
MaximDude
Joined: Wed Nov 22, 2006 3:19 pm Posts: 2073
|
Re: Is this possible?
Since the head is an attachable, it's most likely a no go.
Maybe in B24?
|
Tue Sep 08, 2009 6:49 pm |
|
|
TorrentHKU
Loose Canon
Joined: Sun Mar 29, 2009 11:07 pm Posts: 2992 Location: --------------->
|
Re: Is this possible?
You could easily do it now without the head twist.
|
Tue Sep 08, 2009 8:04 pm |
|
|
MaximDude
Joined: Wed Nov 22, 2006 3:19 pm Posts: 2073
|
Re: Is this possible?
Hyperkultra wrote: You could easily do it now without the head twist. The head twist it probably, like, the whole point...
|
Tue Sep 08, 2009 8:05 pm |
|
|
Areku
Joined: Fri Oct 17, 2008 9:46 pm Posts: 5212 Location: The Grills Locker.
|
Re: Is this possible?
You've freakin' stolen my idea. Well yeah, it is perfectly possible, I was gonna use it in an actor as soon as I was finished with the mod contest. You just use mail's attachable script to search for actors near your unit, get their attachable's MOIDs, detach, and perhaps add some AngularVel to make it seem like their necks broke. Bloody cool, if you ask me. I might code it for you when I'm done with that contest thing. (There is one problem, though: other attachables, such as armor, would also be detached. But I'm sure a workaround solution can be found for that.)
|
Tue Sep 08, 2009 8:35 pm |
|
|
Geti
Joined: Sun Jul 13, 2008 9:57 am Posts: 4886 Location: some compy
|
Re: Is this possible?
yeah, like searching for a presetname with head in it. yes it is possible, though the HFlipped thing could be an issue.
|
Tue Sep 08, 2009 9:22 pm |
|
|
numgun
Joined: Sat Jan 13, 2007 11:04 pm Posts: 2932
|
Re: Is this possible?
Ever since I finished Metal Gear Solid for the first time, I've been addicted to neck snapping ever since. : D Just now I decided to ask because some guys have done wierd Lua hacks I cant understand and are able to access attachables when it was thought impossible. I was thinking it would work only when the actor is unarmed and to perform it, you have to hit the "fire" button 3 or 5 times very fast, just like in MGS (although that needed like 10 presses : x). Also if HFlipped fails, I'm cool with RotAngle = 180; too.
|
Tue Sep 08, 2009 9:25 pm |
|
|
TorrentHKU
Loose Canon
Joined: Sun Mar 29, 2009 11:07 pm Posts: 2992 Location: --------------->
|
Re: Is this possible?
Both do the job equally well.
|
Tue Sep 08, 2009 9:32 pm |
|
|
TheLastBanana
DRL Developer
Joined: Wed Dec 13, 2006 5:27 am Posts: 3138 Location: A little south and a lot west of Moscow
|
Re: Is this possible?
Code: for i = 1,MovableMan:GetMOIDCount()-1 do x = MovableMan:GetMOFromID(i); if x.ClassName == "Attachable" then local head = ToAttachable(x); head.RotAngle = math.pi/2; local actor = ToActor(MovableMan:GetMOFromID(head.RootID)); if actor then actor:SetAimAngle(math.pi/2); actor.Health = 0; end end end This snaps all actor's heads back in the level by making their heads look directly up. When it's snapped this quickly and then they slump forward, it looks pretty convincing. That said, if you still want the real 180-degree head turning deal: Code: for i = 1,MovableMan:GetMOIDCount()-1 do x = MovableMan:GetMOFromID(i); if x.ClassName == "Attachable" then local head = ToAttachable(x); local newhead = CreateAttachable(head.PresetName); newhead.Pos = head.Pos; newhead.HFlipped = not head.HFlipped; head.ToDelete = true; MovableMan:AddParticle(newhead); end end However, if you try this code, you'll notice that it also affects armor on actors and if there is any attachable such as a helmet on the actor's head, there will end up being 2. So probably the first method is best.
|
Wed Sep 09, 2009 12:53 am |
|
|
Areku
Joined: Fri Oct 17, 2008 9:46 pm Posts: 5212 Location: The Grills Locker.
|
Re: Is this possible?
TheLastBanana wrote: Change AimAngle thing I hadn't thought of that. So, erm, well, can I use it?
|
Wed Sep 09, 2009 1:03 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: Is this possible?
Go right ahead. Just make sure to adapt the script to an actor, this just does it to everything on the level. You might also want to discuss with numgun considering the fact that this is his thread, after all.
|
Wed Sep 09, 2009 3:00 am |
|
|
numgun
Joined: Sat Jan 13, 2007 11:04 pm Posts: 2932
|
Re: Is this possible?
Excellent! Now all I need to do is to figure out how to do the tapping key combo work.
EDIT: Say, is it possible to make the head unattach from the torso? So after decapitating the head with a neck snap, the head would fall off the body?
|
Wed Sep 09, 2009 7:14 am |
|
|
numgun
Joined: Sat Jan 13, 2007 11:04 pm Posts: 2932
|
Re: Is this possible?
Problems : ( So far it works, but it keeps snapping the user's neck also. Its funny, but not intended. Code: --NECK SNAP. >: D if self:IsInventoryEmpty() == true then if self:GetController():IsState(Controller.RELEASE_PRIMARY) then self.presses = self.presses + 1; if self.presses == 3 and self.cancelTimer:IsPastSimMS(300) == false then for i = 1,MovableMan:GetMOIDCount()-1 do local x = MovableMan:GetMOFromID(i); if x.ClassName == "Attachable" then local head = ToAttachable(x); local actor = ToActor(MovableMan:GetMOFromID(head.RootID)); --local dist = SceneMan:ShortestDistance(self.Pos, actor.Pos, true).Magnitude if math.abs(actor.Pos.X - self.Pos.X) < 30 and math.abs(actor.Pos.Y - self.Pos.Y) < 30 then actor:SetAimAngle(math.pi/2); head.RotAngle = math.pi/2; actor.Health = -1; end end end self.presses = 0; end self.cancelTimer:Reset(); end end if self.cancelTimer:IsPastSimMS(300) == true then self.presses = 0 end How can I prevent it from snapping my own neck? I've tried self == false, actor ~= self and not self. Noone of these worked, wtf am I doing wrong here?
|
Wed Sep 09, 2009 12:03 pm |
|
|
piipu
Joined: Mon Jun 30, 2008 9:13 pm Posts: 499 Location: Finland
|
Re: Is this possible?
Code: if math.abs(actor.Pos.X - self.Pos.X) < 30 and math.abs(actor.Pos.Y - self.Pos.Y) < 30 and actor.ID ~= self.ID then This should work.
|
Wed Sep 09, 2009 2:33 pm |
|
|
numgun
Joined: Sat Jan 13, 2007 11:04 pm Posts: 2932
|
Re: Is this possible?
It works! Hell yeah! Now all is left is that pesky emitter to show an effect and play the sound. Going to put an extra loud *CRACK* sound for this one.
|
Wed Sep 09, 2009 5:36 pm |
|
|
|