Frictional Games Forum (read-only)
is it possible to... - 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: is it possible to... (/thread-25929.html)

Pages: 1 2


is it possible to... - Amnesiaplayer - 08-21-2014

hello all !
i'm here and yes i have tons of questions Sad
(some peoples hate this)
so...
i learned every (most) scripting this.. but i don't know every possibility...
so i got 1 question about something BUT NOT FOR SCRIPT!
i'm going to search it up for my self Big Grin
i want to make 3 buttons... and 1 lever...
so 2 buttons are in 2 rooms...and the third button is in the middle place but is it possible to lock it ?! AND 1 lever is there to.. is it possible to do this :
click on that button (i'm going to make it big (2x2x2))
(gettign message) "You need to push 2 buttons , and 1 mainbreaker To turn on the Power"
and after clicking on those 2 buttons and 1 mainbreaker it is possible to click on that button... is that possible ?!
and if there is someone that played a game with this objective ?
do you know the name of the game Big Grin


RE: is it possible to... - Mudbill - 08-21-2014

Mainbreaker?

This seems very much possible to do, but your explanation seems a little lacking. Nevertheless I think I know what you mean.

What I suggest you do is add a script area over your middle button. Add an interaction to that area that displays the message with SetMessage, and use variables on the other buttons to check when both have been pressed.

PHP Code:
void PressButton(string &in asEntity)
{
    if(
GetLocalVarInt("Button1") == && GetLocalVarInt("Button2") == 1) {
        
SetEntityActive("Area"false);
        return;
    }
    else 
SetLocalVarInt(asEntity1);


This script should be ran on both the buttons on the sides. It will add a variable when you press them, and, when both have been pressed, disables the area covering your main button. When that area is gone, you can now interact with it instead of the area.

PS: This script assumes that your buttons are named Button1 and Button2 exactly. If you use different names, put those in the variable names.

If you want the player to have to pull the lever as well before interacting with the main button, then instead of having SetEntityActive in the script above, move it to the script for that lever's ConnectionStateChangeCallback.

PHP Code:
void PullLever(string &in asEntityint alState)
{
    if(
GetLocalVarInt("Button1") == && GetLocalVarInt("Button2") == 1) {
        
SetEntityActive("Area"false);
    }




RE: is it possible to... - Amnesiaplayer - 08-21-2014

Okey thanks Big Grin
but i downloaded a Cannon.. ( with an cannonball )
and i want that if you walk... you think you are save... but there is one path and that leads to a cannon... i put already the cannon if you are close the cannon shoots... but the cannonball (is really really ....) it even doesn't shoot .? it just fall from the place where a de Activated it.. (placed it) is it possible to make the (Cannonfire) faster ?! i added the music myself Big Grin


RE: is it possible to... - Mudbill - 08-21-2014

Mostly unrelated to the OP, but have you applied a force to the cannonball? If you only activate it, it will fall down because of gravity. If you want it to move forwards you can either make it into a MoveObject that travels along the X or Z axis at a high speed, or use AddPropForce("Cannonball", 0, 0, 0, "world");

The three numbers must be changed to where you want to push it. If you want it up, for example, you'd make the second number -10000 or so. The axises depend on what direction you want it to fly in. Remember to match it up with the X and Z axises in the level editor.


RE: is it possible to... - Amnesiaplayer - 08-21-2014

it's this

AddPropForce("CannonBall", 10000, 0, 0, "world");

it goes a LITTLE bit to my wat but fall down..


RE: is it possible to... - Mudbill - 08-21-2014

You can combine negative Y and positive X for a curve. If you use 10000 on X and -5000 on Y, perhaps that could work? Feel free to change the numbers if it's not powerful enough.


RE: is it possible to... - Amnesiaplayer - 08-21-2014

nope Sad just a little bit further... i'm trying higher Tongue

i just had this : AddPropForce("CannonBall", 10000, -100000, 0, "world");

and the cannon ball Fall down.. REALLY FAST... like what i would... that it come to me :S


RE: is it possible to... - FlawlessHappiness - 08-21-2014

Y should not be negative. Negative Y means it will go down, and that's of course not what you want.
Use a positive Y to make the movement of the cannonball an arch ^^


RE: is it possible to... - Mudbill - 08-21-2014

I think I'm too used to co-ordinate systems. -Y is usually up, but of course, this matches the level editor, so +Y is of course up. My bad.


RE: is it possible to... - Amnesiaplayer - 08-21-2014

so y is the third thing ?