GoreGrinder99
Member
Posts: 166
Threads: 47
Joined: Feb 2013
Reputation:
1
|
How to reverse tinderbox ignite mechanic?
I have been trying to fiddle with reversing the tinderbox. What I want going is instead of having to light torches, candles, et cetera, I want to snuff them out with the use of a "tinderbox" (which obviously wont be a tinderbox but rather a re-usable inventory item similar to a lantern; infinite "tinderboxes").
So the main things I can't figure out:
1.How to disable the tinderbox ignite hover with the "x#) over the light source.
2.Reverse the lighting capability. Instead of having to lite, I need to put it out.
I have noticed that the only light interaction there is is to lite it, and once lite, no longer can be interacted with. I have messed around with the SetLampLit but to no luck.
Just a little extra something. I have found a way to completely disable the use of the lantern, remove the inventory icon and sounds and such but that first inventory space is still utilized by the lantern. Is there a way to remove the lantern completely? Everything else I've tried has resulted in a crash.
-Grind to the Gore-
(This post was last modified: 10-06-2013, 12:28 PM by GoreGrinder99.)
|
|
10-06-2013, 11:43 AM |
|
Romulator
Not Tech Support ;-)
Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation:
195
|
RE: How to reverse tinderbox ignite mechanic?
Dunno how to remove tinderbox thing without deleting the tinderbox drawing itself, nor the number, but you may be able to reverse the lighting by adding Interact Callbacks, then setting the candlestick to be unlit.
Or if that doesn't work, you can put a Script Area around the candlestick(s) and/or lamp(s), which if interacted with causes the light to turn off. The only problem with this is the excessive script areas and quite strenuous lengths of coding required.
Discord: Romulator#0001
|
|
10-06-2013, 01:41 PM |
|
GoreGrinder99
Member
Posts: 166
Threads: 47
Joined: Feb 2013
Reputation:
1
|
RE: How to reverse tinderbox ignite mechanic?
(10-06-2013, 01:41 PM)Romulator Wrote: Dunno how to remove tinderbox thing without deleting the tinderbox drawing itself, nor the number, but you may be able to reverse the lighting by adding Interact Callbacks, then setting the candlestick to be unlit.
Or if that doesn't work, you can put a Script Area around the candlestick(s) and/or lamp(s), which if interacted with causes the light to turn off. The only problem with this is the excessive script areas and quite strenuous lengths of coding required.
The inventory isn't a problem, that has been taken care of, just the mouse over ignite "x#" display.
I have tried callbacks but can only get them to work on pickup but that being the case, the light sources are extinguished upon the pickup.
I guess interact areas would work, I didn't think about that.
-Grind to the Gore-
(This post was last modified: 10-06-2013, 02:10 PM by GoreGrinder99.)
|
|
10-06-2013, 02:06 PM |
|
Apjjm
Is easy to say
Posts: 496
Threads: 18
Joined: Apr 2011
Reputation:
52
|
RE: How to reverse tinderbox ignite mechanic?
You should be able to perform:
void SetEntityCallbackFunc(string& asName, string& asCallback);
On each light source. Specify the callback function as follows:
void cbIgnoreIgnite(string &in asEntity, string &in type)
{
AddDebugMessage(asEntity " callback: " + type,false);
if(type == "OnIgnite")
{
}
}
To let you capture the ignite event in code.
You could then create custom light entities, which have the lights + effects on by default, and then use the above approach to turn them off when they become lit. E.g.:
void cbIgnoreIgnite(string &in asEntity, string &in type)
{
AddDebugMessage(asEntity " callback: " + type,false);
if(type == "OnIgnite")
{
//Ignite event triggered -> turn off the light
SetLightVisible(asEntity + "_Light_1",false);
DestroyParticleSystem(asEntity + "_Some_Entity_Particle_System");
//Or you could replace the light entity with an off version of the entity using the new ReplaceProp function
}
}
(This post was last modified: 10-06-2013, 03:21 PM by Apjjm.)
|
|
10-06-2013, 03:15 PM |
|
Daemian
Posting Freak
Posts: 1,129
Threads: 42
Joined: Dec 2012
Reputation:
49
|
RE: How to reverse tinderbox ignite mechanic?
For the icon, try these functions:
ShowPlayerCrossHairIcons
SetEntityCustomFocusCrossHair
|
|
10-06-2013, 04:15 PM |
|
GoreGrinder99
Member
Posts: 166
Threads: 47
Joined: Feb 2013
Reputation:
1
|
RE: How to reverse tinderbox ignite mechanic?
(10-06-2013, 03:15 PM)Apjjm Wrote: You should be able to perform:
void SetEntityCallbackFunc(string& asName, string& asCallback);
On each light source. Specify the callback function as follows:
void cbIgnoreIgnite(string &in asEntity, string &in type)
{
AddDebugMessage(asEntity " callback: " + type,false);
if(type == "OnIgnite")
{
}
}
To let you capture the ignite event in code.
You could then create custom light entities, which have the lights + effects on by default, and then use the above approach to turn them off when they become lit. E.g.:
void cbIgnoreIgnite(string &in asEntity, string &in type)
{
AddDebugMessage(asEntity " callback: " + type,false);
if(type == "OnIgnite")
{
//Ignite event triggered -> turn off the light
SetLightVisible(asEntity + "_Light_1",false);
DestroyParticleSystem(asEntity + "_Some_Entity_Particle_System");
//Or you could replace the light entity with an off version of the entity using the new ReplaceProp function
}
}
I got the particle system, billboard and light to remove but the internal particle of the candle itself still ignites. Guess I'll have to make a copy and remove it myself for my game. Thank you for the help!!! +1
-Grind to the Gore-
(This post was last modified: 10-06-2013, 07:47 PM by GoreGrinder99.)
|
|
10-06-2013, 06:29 PM |
|
|