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

Using the pie menu to set the fuse on plastic explosives
http://forums.datarealms.com/viewtopic.php?f=73&t=30997
Page 1 of 1

Author:  trotskygrad [ Tue May 15, 2012 5:09 pm ]
Post subject:  Using the pie menu to set the fuse on plastic explosives

I'm curious whether the pie menu could be used for this functionality without converting a TDExplosive to a HDFirearm, or deleting/reequipping an item to an actor's inventory

There appears to be no lua function that can be called on a TDExplosive that's equivalent to the SetNextMagazine of HDFirearms.

Author:  CaveCricket48 [ Tue May 15, 2012 9:42 pm ]
Post subject:  Re: Using the pie menu to set the fuse on plastic explosives

I'm not completely sure what you're trying to do.

Author:  trotskygrad [ Tue May 15, 2012 10:21 pm ]
Post subject:  Re: Using the pie menu to set the fuse on plastic explosives

CaveCricket48 wrote:
I'm not completely sure what you're trying to do.


so I'm trying to make a settable fuse on a timed explosive item (like 5 seconds or 10 seconds)

I would like to do this via the pie menu, yet I can't change anything about the TDExplosive through pie menu functions.

HDFirearms have a "Change Next Magazine" function that allows you to change that, but TDExplosives have no method that modifies the data about them.

Author:  CaveCricket48 [ Wed May 16, 2012 12:03 am ]
Post subject:  Re: Using the pie menu to set the fuse on plastic explosives

You could go full Lua on this, by using the pie menu function to set the Sharpness of the grenade, and the grenade has a script that makes it detonate based on the value of its Sharpness.

Author:  trotskygrad [ Wed May 16, 2012 12:54 am ]
Post subject:  Re: Using the pie menu to set the fuse on plastic explosives

CaveCricket48 wrote:
You could go full Lua on this, by using the pie menu function to set the Sharpness of the grenade, and the grenade has a script that makes it detonate based on the value of its Sharpness.


that sounds easy, but why sharpness? sounds like a rather arbitrary variable

also, what are the functions for setting and reading sharpness, respectively? (I don't feel like API diving, just curious if you know them off the top of your head)

Author:  CaveCricket48 [ Wed May 16, 2012 12:58 am ]
Post subject:  Re: Using the pie menu to set the fuse on plastic explosives

Sharpness is a variable that doesn't have any effect on MOs that are larger than a single pixel, so it's good for storing values. To set/get it you simply do
Code:
yourObjectPointer.Sharpness = 12;

letsDoMath = yourObjectPointer.Sharpness + 5;

Alternatively, because I forgot the pie menu script is actually attached to the weapon (har har har), you just have the value stored in a variable in the script.

Author:  trotskygrad [ Wed May 16, 2012 2:05 am ]
Post subject:  Re: Using the pie menu to set the fuse on plastic explosives

CaveCricket48 wrote:
Sharpness is a variable that doesn't have any effect on MOs that are larger than a single pixel, so it's good for storing values. To set/get it you simply do
Code:
yourObjectPointer.Sharpness = 12;

letsDoMath = yourObjectPointer.Sharpness + 5;

Alternatively, because I forgot the pie menu script is actually attached to the weapon (har har har), you just have the value stored in a variable in the script.


ah ok thanks.

I finally can get that nobel 808 working properly >:3

do you think you'll add more variables in the future? Say I wanted to keep track of 2 quantities or something.

Author:  CaveCricket48 [ Wed May 16, 2012 2:13 am ]
Post subject:  Re: Using the pie menu to set the fuse on plastic explosives

If you're talking about INI variables, that's what Data does, not me.

Author:  trotskygrad [ Wed May 16, 2012 2:30 am ]
Post subject:  Re: Using the pie menu to set the fuse on plastic explosives

CaveCricket48 wrote:
If you're talking about INI variables, that's what Data does, not me.


well, that was a collective you, as in "the dev team"

Author:  Bad Boy [ Wed May 16, 2012 3:17 am ]
Post subject:  Re: Using the pie menu to set the fuse on plastic explosives

You can also use lifetime and classname. Neither of them are as good as sharpness since they both have disadvantages but they still do the same thing. The ability to make your own lua rewritable and externally accessible (e.g. via an activity) properties that don't actually do anything in the ini would be great but maybe that'd be a tonne of work to implement. Failing that, getting more properties that do nothing would be good too, so there's less worry of messing up another script by changing sharpness or whatever.

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