Frictional Games Forum (read-only)
Tinderbox inventory detection or Reset ignite property: I need one! - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Tinderbox inventory detection or Reset ignite property: I need one! (/thread-10563.html)

Pages: 1 2 3


RE: Tinderbox inventory detection or Reset ignite property: I need one! - MrBigzy - 10-03-2011

"tinderbox" didn't work?

Actually now that I think of it, tinderboxes aren't really an inventory item anyway.


RE: Tinderbox inventory detection or Reset ignite property: I need one! - Your Computer - 10-03-2011

I've decided to go with an ever-regenerating tinderbox supply for my purpose. However, if anyone has managed to get this to work otherwise, please post!


RE: Tinderbox inventory detection or Reset ignite property: I need one! - palistov - 10-03-2011

I believe you're looking for "OnIgnite" type? To make sure the player actually ignites a lamp before running your script. I had to utilize this when I scripted multiple lights to fade in after a player lit their corresponding candle/lantern/lamp.

void Ignite(string &in entity, string &in type)
{
if(type == "OnIgnite") //Do stuff
}


RE: Tinderbox inventory detection or Reset ignite property: I need one! - Your Computer - 10-03-2011

(10-03-2011, 04:47 AM)palistov Wrote: I believe you're looking for "OnIgnite" type?

Whoops, i misspelled the value in my previous post, but in my script i had "OnIgnite".

Wait, that gives me an idea. Nope, idea didn't work.


RE: Tinderbox inventory detection or Reset ignite property: I need one! - palistov - 10-03-2011

Ahh OK. Well SetLampLit("cannon", false, true); should work. Perhaps make a separate function in case there is an issue setting a lamp unlit as a result of it being lit (sounds strange haha).

Code:
void Ignite(string &in entity, string &in type)
{
if(type == "ignite") AddTimer("unlit", 0.01, "Unignite");
}

void Unignite(string &in timer)
{
SetLampLit("cannon", false, true);
}

or try this too:


void Ignite(string &in entity, string &in type)
{
if(type == "ignite") Unignite();
}

void Unignite();
{
SetLampLit("cannon", false, true);
}



RE: Tinderbox inventory detection or Reset ignite property: I need one! - Your Computer - 10-03-2011

SetLampLit() doesn't reset the ability to light the entity again after the callback has been called.


RE: Tinderbox inventory detection or Reset ignite property: I need one! - palistov - 10-03-2011

Hmm, interesting. I'm stumped then. Hopefully someone can come up with a clever solution :3


RE: Tinderbox inventory detection or Reset ignite property: I need one! - MrBigzy - 10-03-2011

There must of been a time in the main game where you lit a lamp, the wind blew them out and you could light them again...hmm...



RE: Tinderbox inventory detection or Reset ignite property: I need one! - Your Computer - 10-03-2011

(10-03-2011, 11:12 AM)MrBigzy Wrote: There must of been a time in the main game where you lit a lamp, the wind blew them out and you could light them again...hmm...

I would still run into the same issue if i were to duplicate it and use SetEntityCallbackFunc().


RE: Tinderbox inventory detection or Reset ignite property: I need one! - Tanshaydar - 10-03-2011

I have a very weird workaround, but did you think of using create entity at area? I'm thinking that canon would be static, not that we would move it?