![]() |
Restore rusty valve when you die (still unsolved) - 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: Restore rusty valve when you die (still unsolved) (/thread-17384.html) Pages:
1
2
|
RE: Restore rusty valve when you die (still unsolved) - Apjjm - 08-14-2012 Here is one way you can use CreateEntityAtArea (as others have suggested). Put a script area around where you want the valve to appear. Ill Assume for now you called it "ScriptArea_Valve". Don't put a valve there at the start. As we want to be able to generate an infinite number of valves we are going to want a way to generate new names for them. That's where this first function comes in: Code: //Function for generating unique names Next we want to use this code to be able to create valves. We will create another function which will create a valve at a specified area. Code: //Create a new valve entity at an area Now we have the code down to generate valves, we need to make a valve spawn when we start the map, as well as set up the checkpoint (your checkpoint code is probably elsewhere rather than OnStart though). Code: void OnStart() Finally, all we need to do is disable the old valve and create a new one on death: Code: void cbDeath_ValveChase(string &in asName, int alCount) There are some blanks you will have to fill in, and that code untested but provided you can activate/deactivate the entity you are using this should work. RE: Restore rusty valve when you die (still unsolved) - Steve - 09-03-2012 I think my brain just went brain dead :| I'll gonna try to figure it out somehow ![]() RE: Restore rusty valve when you die (still unsolved) - Apjjm - 09-03-2012 I can put together a sample map - i shall edit back later this evening when i get chance to put it together. RE: Restore rusty valve when you die (still unsolved) - Steve - 09-03-2012 That would be nice thank you ![]() RE: Restore rusty valve when you die (still unsolved) - Apjjm - 09-03-2012 Ok here is a very basic example map: https://dl.dropbox.com/u/64805489/Breakable_spawning_example.zip When you use the breakable valve some piano music plays, and when you use the lantern you die (so that you can test the checkpoint code). All the script is commented so you should be able to see what you need to copy out into your code. The only point of interest in the level editor is the script area. RE: Restore rusty valve when you die (still unsolved) - Steve - 09-04-2012 okay I know this took probaly some time to make I think I can handle it with this but one question I have like when you toch an area the valve will easy said break I have: AddPropHealth("valve_iron_rusty_breakable_1", 100); should I just make it; AddPropHealth("CurrentValvename", 100); //////litterly////// or wait I think I need newvalvename ig i'm wrong you may correct me I'll start to try this now ![]() RE: Restore rusty valve when you die (still unsolved) - Apjjm - 09-04-2012 Ah, well rusty valve is a bit of a weird prop, so that approach won't work. The valve is actually a multi-body prop with a breakable joint. If you want to break the joint without the player touching the valve, all you need to do is apply a small impulse to the valve, and that will break the joint (You can also use BreakJoint - but you'd still need an impulse otherwise the wheel won't fall off the valve). The following code assumes you have an area called ScriptArea_BreakValve, which if the player enters breaks the valve. Code: void OnStart() RE: Restore rusty valve when you die (still unsolved) - Steve - 09-04-2012 Finaly I got it thanks to all you guys especially Apjjm Edit: I didn't see jet what you said but it worked because I already had prop force to let it shoot allitle to the left because you "hit" it with a rockbut thanks |