ok i need a little help... i dont know how to make that two triggers will open one door so heres the question:
do anyone know how to make that 2 triggers will open 1 door
plz help ^^
tnx
2 trigger = 1 door
Moderator: Core Staff
2 trigger = 1 door
__________________________________________________________
THE MAPPER
__________________________________________________________
THE MAPPER
__________________________________________________________
-
- Core Staff
- Posts: 2030
- Joined: July 24th, 2006, 11:21 am
- Location: Cramped in a small cubicle/making another jump map
Re: 2 trigger = 1 door
Same scripting as with one door, only give the two triggers the same targetname.
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
-
- Core Staff
- Posts: 2030
- Joined: July 24th, 2006, 11:21 am
- Location: Cramped in a small cubicle/making another jump map
Re: 2 trigger = 1 door
Code: Select all
//Simple door opening script by Rezil
main()
{
thread mp_jm_mapname_door(); //Change to avoid conflicts with other .gscs
}
mp_jm_mapname_door()
{
t = getent("trig","targetname"); //trig is the targetname of the trigger you will use to open the door
d = getent("door","targetname"); //door is the targetname of the actual door that will open and "d" is what we will call it in the script
while(1)
{
t waittill("trigger", user); //wait for the user to trigger
d rotateyaw(90,1,0.5,0.2); //this rotates the entity(in our case, "door") 90 degrees in 1 second with the entity accelerating 0.5 seconds and deccelrating for 0.2 seconds
d waittill("rotatedone"); //wait for the door to stop rotating, better than simply using the wait command as it prevents bugging the door(blocking it)
t delete(); //door is open, delete trigger
}
}
Code: Select all
//A bit more advanced door opening script by Rezil
main()
{
level.is_door_open = false; //Define a global boolean(true/false) variable that will be used for checking whether the door is open or not
thread mp_jm_mapname_door(); //Change to avoid conflicts with other .gscs
}
mp_jm_mapname_door()
{
t = getent("trig","targetname"); //trig is the targetname of the trigger you will use to open the door
d = getent("door","targetname"); //door is the targetname of the actual door that will open and "d" is what we will call it in the script
while(1) //while true, infinite loop basically
{
t waittill("trigger", user); //wait for the user to trigger
if(level.is_door_open) //if the global variable is_door_open is true
{
d rotateyaw(90,1,0.5,0.2);
d waittill("rotatedone");
//user iprintln("Door open."); //Optionally inform the user that the door is open
}
else { //do this if all other checks are false - you could do the same with if(!level.is_door_open)
d rotateyaw(-90,1,0.5,0.2); //-90, close the door
d waittill("rotatedone");
//user iprintln("Door closed."); //Optionally inform the user that the door is closed
}
}
}
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
Who is online
Users browsing this forum: No registered users and 1 guest