View unanswered posts | View active topics It is currently Thu Mar 28, 2024 8:29 am



Reply to topic  [ 10 posts ] 
 Using the pie menu to set the fuse on plastic explosives 
Author Message
User avatar

Joined: Mon Nov 14, 2011 8:58 pm
Posts: 92
Reply with quote
Post 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.


Tue May 15, 2012 5:09 pm
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13143
Location: Here
Reply with quote
Post Re: Using the pie menu to set the fuse on plastic explosives
I'm not completely sure what you're trying to do.


Tue May 15, 2012 9:42 pm
Profile
User avatar

Joined: Mon Nov 14, 2011 8:58 pm
Posts: 92
Reply with quote
Post 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.


Tue May 15, 2012 10:21 pm
Profile
User avatar

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


Wed May 16, 2012 12:03 am
Profile
User avatar

Joined: Mon Nov 14, 2011 8:58 pm
Posts: 92
Reply with quote
Post 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)


Wed May 16, 2012 12:54 am
Profile
User avatar

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


Wed May 16, 2012 12:58 am
Profile
User avatar

Joined: Mon Nov 14, 2011 8:58 pm
Posts: 92
Reply with quote
Post 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.


Wed May 16, 2012 2:05 am
Profile
User avatar

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


Wed May 16, 2012 2:13 am
Profile
User avatar

Joined: Mon Nov 14, 2011 8:58 pm
Posts: 92
Reply with quote
Post 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"


Wed May 16, 2012 2:30 am
Profile

Joined: Fri Sep 10, 2010 1:48 am
Posts: 666
Location: Halifax, Canada
Reply with quote
Post 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.


Wed May 16, 2012 3:17 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 10 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.245s | 15 Queries | GZIP : Off ]