Frictional Games Forum (read-only)

Full Version: Tinderbox inventory detection or Reset ignite property: I need one!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
So i have a couple of ways of detecting interaction from the player for lamp entities, but one of them allows for triggering the callback even though the user has no tinderboxes, and the other only allows for igniting the object once. If i can get the amount of tinderboxes the user has or if i can somehow reset the object from having its ignition set, then i can have things working as i want them to. I have an alternative method to all of this, but it requires more effort from the player, so i would like to avoid this alternative for now.

I've tried resetting the entity through ResetProp(), but that did not reset its ignition; and i've tried using wildcards in HasItem(), but it keeps returning false.
I'm not exactly sure what you're getting at, but I think you could have a global variable integer that increases by every interaction between the player and a tinderbox. So that once the player has a tinderbox, you might be able to set every turned off candle as a static, uninteractible object while having an interaction area that checks if the player has a tinderbox and then add a fire particle effect on the top of the candle. Finally, it should also subtract the global variable by one per interaction between the player and the area. Though it may be some work planning it out across multiple levels, it should do the job right.
I guess i should have mentioned that this is for my cannon i'm working on for my Teamnesia story. To explain it further, in the level editor i can set a callback (under "CallbackFunc") to the entity, which one of the parameters is capable of providing "OnIgnite" as its value. However, using that method only allows for "igniting" the entity once. If i use SetEntityPlayerInteractCallback(), this allows for lighting the object even without tinderboxes.

I'll use your method for my other custom story, but as you could imagine that method won't work for Teamnesia (at least not without the cooperation of everyone else).
SetEntityCallbackFunc(string& asName, string& asCallback);

What type of entity is it? Could you perhaps make it a lamp and setlamplit = false.

This seems like something I should be able to solve Smile Can't find the model though. It wasn't Sel's canon.
Why would you need wildcards for HasItem? Isn't it just tinderboxes?
(10-02-2011, 10:21 PM)Acies Wrote: [ -> ]SetEntityCallbackFunc(string& asName, string& asCallback);

What type of entity is it? Could you perhaps make it a lamp and setlamplit = false.

Already tried those. The cannon is a lamp entity, so if you can get this to work with another lamp entity, great! Also, you're not going to find this cannon anywhere until i release it; i made it myself.

(10-02-2011, 10:30 PM)MrBigzy Wrote: [ -> ]Why would you need wildcards for HasItem? Isn't it just tinderboxes?

I figured since the player picked up "tinderbox_"+n that perhaps the game stores the names of the tinderbox entities, hoping that HasItem() supports wildcards. "tinderboxes" returns false also.
Does the entity callback returns true for ignition even if player has no tinderboxes?
(10-02-2011, 10:51 PM)Tanshaydar Wrote: [ -> ]Does the entity callback returns true for ignition even if player has no tinderboxes?

For SetEntityCallbackFunc() the callback is not triggered when the user has no tinderboxes and tries to interact with the entity. However, after the user obtains tinderboxes, once triggered i can no longer light the entity again even if i pass false to SetLampLit().
That's really weird. You know I made some modern lamps to be litable with using light bulbs and OnIgnite state always works for me. I'll check my levels if I can reproduce your case.
looks like the only alternative to ResetProp is CreateEntityAtArea... - maybe after each shot is fired, create another cannon with a new name. I know it's not optimised but it might be your only workaround..
Pages: 1 2 3