Data Realms Fan Forums
http://forums.datarealms.com/

Actor requiring a certain device to activate?
http://forums.datarealms.com/viewtopic.php?f=1&t=46254
Page 1 of 1

Author:  gridbull [ Sat Mar 03, 2018 7:33 pm ]
Post subject:  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!

Author:  CaveCricket48 [ Sat Mar 03, 2018 8:03 pm ]
Post subject:  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).

Author:  Bad Boy [ Sat Mar 03, 2018 9:10 pm ]
Post subject:  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.

Author:  gridbull [ Sun Mar 04, 2018 1:32 am ]
Post subject:  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.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/