Is it possible for a trigger to wait for a key to be pressed or a varriable to be above a certain point and then trigger?
Also, is it possible to have a door that can reduce a variable when activated. Are you able to tell me how this is possible.
Thanks
Keyboard and Triggers
- QuestOfDreams
- Site Admin
- Posts: 1520
- Joined: Sun Jul 03, 2005 11:12 pm
- Location: Austria
- Contact:
Re: Keyboard and Triggers
Best option would be to use a LevelController entity and script the desired behaviour.wabogenadod wrote:Is it possible for a trigger to wait for a key to be pressed or a varriable to be above a certain point and then trigger?
Depends on the details. If, for example, the door is activated by a trigger you may use the same trigger to activate a ModifyAttribute entity (a player attribute can be regarded as a variable).wabogenadod wrote:Also, is it possible to have a door that can reduce a variable when activated.
-
- Posts: 18
- Joined: Mon Dec 17, 2012 9:59 pm
Re: Keyboard and Triggers
Does a LevelController act like a trigger?
Would this work?
"
{
K_OpenDoor = [16]
Setup[()
{
LowLevel("RunPlayer");
}]
RunPlayer[()
{
If(IsKeyDown(K_OpenDoor))
{
If(GetAttribute("points", "Player") > 75)
{
ModifyAttribute("points", -75, "Player")
How would you trigger door??????????????????????????????????????????????????
}
}
}]
}
(The main problem is that i don't understand how to use it to trigger models or entities)
Would this work?
"
{
K_OpenDoor = [16]
Setup[()
{
LowLevel("RunPlayer");
}]
RunPlayer[()
{
If(IsKeyDown(K_OpenDoor))
{
If(GetAttribute("points", "Player") > 75)
{
ModifyAttribute("points", -75, "Player")
How would you trigger door??????????????????????????????????????????????????
}
}
}]
}
(The main problem is that i don't understand how to use it to trigger models or entities)
- QuestOfDreams
- Site Admin
- Posts: 1520
- Joined: Sun Jul 03, 2005 11:12 pm
- Location: Austria
- Contact:
Re: Keyboard and Triggers
The LevelController itself is not a trigger but provides a way to control triggers, doors, platforms, globals script flags, ...
LevelController scripts have their own set of script methods (many of them are similar to the pawn script methods) and are purely low level.
LevelController scripts have their own set of script methods (many of them are similar to the pawn script methods) and are purely low level.
Code: Select all
{
K_OpenDoor = [16]
CheckKeyPress[()
{
if(IsKeyDown(K_OpenDoor))
{
if(GetAttribute("points", "Player") > 75)
{
ModifyAttribute("points", -75, "Player");
// activates the specified Trigger entity
ActivateTrigger("DoorTriggerEntity");
// or
// activates the specified Trigger (no Trigger entity required)
SetEventState("DoorTrigger", true);
// or
// directly activates the door "Door" and makes it run to the given animation time 2.0
SetDoorTargetTime("Door", 2.0);
}
}
}]
}
-
- Posts: 18
- Joined: Mon Dec 17, 2012 9:59 pm
Re: Keyboard and Triggers
What needs to go in the entity attributes if the script is called levelcontroller(door)?
-
- Posts: 18
- Joined: Mon Dec 17, 2012 9:59 pm
Re: Keyboard and Triggers
Why is it that the levelcontroller is crashing my game when i have entered all of the attributes correctly?
- QuestOfDreams
- Site Admin
- Posts: 1520
- Joined: Sun Jul 03, 2005 11:12 pm
- Location: Austria
- Contact:
Re: Keyboard and Triggers
You should not use parentheses in file names (or other identifiers). Stick to alphanumeric characters and underscores.wabogenadod wrote:What needs to go in the entity attributes if the script is called levelcontroller(door)?
You need to provide more information, i.e. entity parameters, script, RealityFactory.log file.wabogenadod wrote:Why is it that the levelcontroller is crashing my game when i have entered all of the attributes correctly?
Re: Keyboard and Triggers
Did you use console (true) to watch messages for during which part it stops,if the script is that crashes it,or checked other simple details like: in the triggername entry where you have to write the word "programmed" .