Frictional Games Forum (read-only)
Replacing tinderboxes and lantern - 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: Replacing tinderboxes and lantern (/thread-19371.html)



Replacing tinderboxes and lantern - JonnyAnomaly - 11-27-2012

I was wondering if it would be possible to change the mechanic of the tinderboxes and lantern, so I could replace tinderboxes with matches, but the matches would also be used to replace the lantern - So that when you bring the lantern out, you use a match (tinderbox) which only lasts a minute or so - You can only do this if you have a match in the inventory, when they're gone that's it. I guess replacing the tinderboxes would be possible, but changing the way the lantern itself works I'm not sure?

Also I wanted to ask if its possible to make a light move at from position to position, like the lights outside a moving vehicle?


RE: Replacing tinderboxes and lantern - Alex Ros - 11-27-2012

Everything you said is possible.
You have to script the functionality of the matches first of all.
Second you have to script the deletion of one match, when a player uses a lantern.
And for the last you have to model a second hand (with a match) and animate the whole process of firing up the lantern with a match.

Best of luck!


RE: Replacing tinderboxes and lantern - The chaser - 11-27-2012

I think you can do that with a full-conversion.


RE: Replacing tinderboxes and lantern - Your Computer - 11-27-2012

Scripts cannot directly access tinderboxes.


RE: Replacing tinderboxes and lantern - JonnyAnomaly - 11-27-2012

Thanks for the replies - I will be doing a total conversion I think, as there are a number of things I would like to try to modify/add. Your Computer, just read you tutorial on setting up a total conversion. Very helpful, thanks!


RE: Replacing tinderboxes and lantern - JonnyAnomaly - 11-30-2012

How would you actually move a light? I've been looking through the possible scripting involved and can't find anything apart from rotating an object. Would it be a animation made in maya which is assigned to the light?


RE: Replacing tinderboxes and lantern - The chaser - 11-30-2012

Make an invisible model with a light attached and move the object. Simple as that.


RE: Replacing tinderboxes and lantern - JonnyAnomaly - 12-03-2012

Thanks, I managed to get that to work but I'm having a problem. Basically, I want the light to move along the length of a train, and once it gets to a certain point, it will reset and start its movement over again and keep looping. I managed to get the light to move properly at the start, but it won't ever repeat the movement. Here is my script:


void OnStart()

{
SetEntityActive("block_box_1", true);
SetMoveObjectStateExt("block_box_1", 1, 2, 10.0f, 0.1f, true);
AddTimer("", RandFloat(1.0f, 20.0f), "TrainLights");
}
void ResetLights(string &in asParent, string &in asChild, int alState)
{
ResetProp("block_box_1");
AddTimer("", RandFloat(10.0f, 20.0f), "TrainLights");
}
void TrainLights(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("block_box_1", true);
SetMoveObjectStateExt("block_box_1", 1, 2, 10.0f, 0.1f, true);
AddTimer("", RandFloat(25.0f, 30.0f), "ResetLights");
}

I have also set the AutoMoveStateGoal in the model editor to 100 so it will travel enough to cover the length of the train. I have an OpenState of 1.0 and the AutoMove button is checked.