View unanswered posts | View active topics It is currently Sun Dec 01, 2024 5:26 am



Reply to topic  [ 4 posts ] 
 Actor requiring a certain device to activate? 
Author Message
User avatar

Joined: Sun Sep 17, 2017 11:17 pm
Posts: 35
Reply with quote
Post Actor requiring a certain device to activate?
I'm designing a kind of disposable combat robot, something possibly used by futuristic riot police.

My first idea was to have them locked in a powered down state until you buy a seperate remote control device for them, and destroying the device would shut them all down again.

And my second idea was to make losing their head not lethal, but more of a debuff. Without their head they start to short circuit and lose control, firing randomly and moving jerkily and awkwardly. I know how to make a false head with the real one as Null.bmp, I'm just uncertain how to do the rest of it.

If either idea is at all plausible, or even interesting, do let me know. I'm more or less competent with Lua and willing to do most of it myself.

Cheers!


Sat Mar 03, 2018 7:33 pm
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: Actor requiring a certain device to activate?
Remote-control device shouldn't be too hard - script on the robot, check if all actors on their team have the device, or check if the device is lying around in the scene somewhere. You can use
Code:
ToActor(self):GetController():SetState(Controller.BODY_JUMP,false);

To stop the actor from jumping. You can see a list of controller states here.

Non-lethal head loss can be done by having a null-sprite head and giving it an attachable that has the actual head sprite - when the attachable is destroyed, the actor will appear "headless". The actor can have a script to check whether or not the fake head is still attached, and then do things based on that.

Keep in mind there's a bug with Lua pointers to MOs getting scrambled whenever something in the game gibs/dies, so you want to make sure you're constantly verifying that the pointer is to the correct thing (UniqueID check would probably be fine for a GetsHitByMOs = 1 MO).


Sat Mar 03, 2018 8:03 pm
Profile

Joined: Fri Sep 10, 2010 1:48 am
Posts: 666
Location: Halifax, Canada
Reply with quote
Post Re: Actor requiring a certain device to activate?
If you want to shut them down completely so they're not controllable by you or by the ai you can also set their controller input mode to CIM_DISABLED. Info on that is on the same page cc posted.


Sat Mar 03, 2018 9:10 pm
Profile
User avatar

Joined: Sun Sep 17, 2017 11:17 pm
Posts: 35
Reply with quote
Post Re: Actor requiring a certain device to activate?
Much more complex than anything else I've made with lua so far, I guess this marks my first steps into the great unknown.
Thanks a lot guys, set me on the right direction, and that page you linked me has given me some other good ideas too :D
hopefully my mod faction will be up for release here soon, in the meantime I'll post here if I have any more issues.


Sun Mar 04, 2018 1:32 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 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.026s | 16 Queries | GZIP : Off ]