Need some editing in a couple scripts

Topics regarding Scripting with Reality Factory
Post Reply
Veleran
Posts: 891
Joined: Mon Aug 22, 2005 10:22 am
Location: Greece

Need some editing in a couple scripts

Post by Veleran »

I have two scripts that need a look upon.

The first is the death section of generic monster,in which the SetLODDistance doesnt work.
The second is a pressure plate pawn script that doent work at all-mot even the idle animation is played-not even console = true.

Death[ ()
{
DelTimerOrder(1); // remove alert timer
AddPainOrder("IdlePain", 0); // remove pain order
FindTargetOrder(0, "FoundTarget", DAMAGEATTRIBUTE); // remove target finding
DelTriggerOrder("IdleToAlert"); // remove alert trigger
switch(random(1,4)) // chose between 4 death animations
{
case 1
{
AnimateStop(DIE, DIEHOLD, DIESOUND);
}
case 2
{
AnimateStop(DIE1, DIEHOLD, DIESOUND1);
}
case 3
{
AnimateStop(DIE2, DIEHOLD, DIESOUND2);
}
case 4
{
AnimateStop(DIE3, DIEHOLD, DIESOUND3);
}
}
IsPushable(true);
SetLODDistance(10, 50, 100, 539, 540);
} ]

--The pressure plate --------------

{
Spawn[ ()
{
Console(true);
BoxWidth(34);
BoxHeight(3);
NewOrder("Unpressed");
} ]

unpressed_start[ ()
{
HighLevel("Unpressed");
}

Unpressed[ ()
{
SetEventState("Plate1_1_pressed", false);
PlayerDistOrder(10,"pressed_Start");
} ]

pressed_Start[ ()
{
LowLevel("pressed");
} ]

pressed[ ()
{
ForceDown(2);
SetEventState("Plate1_1_pressed", true);
PlayerDistOrder(60,"unpressed_start");
} ]


I had this pressure plate work with a similar script-with only th ebasics-
by using "move" instead of force,but the plate moved forwards instead of downwards.

{
Spawn[ ()
{
Console(true);
BoxWidth(40); // set bounding box width/depth
NewOrder("Wait");
} ]

Wait[ ()
{
PlayerDistOrder(20, "Pressed");
} ]

Pressed[ ()
{
Move("Idle", 12, 3, 0, 0, -4, "Menu/menuclick.wav");
SetEventState("plate1pressed", true);
} ]

}

I can do the pressure plates(which open doors)with world moving platforms or doors because they cant stay down as long as an actor is upon them.I tried all settings in both doors and moving platforms and thay wont do what a pressure plate needs.
The world models move down and then return up to the starting key frame.
The good thing with world models is that they can work with all actors.

And:I DONT WANT the pressure plate to be controled only by the player,but by any pushable actor(so i can push rocks on the plates,and push away from the plates the corpses-so they cant inerfere with the puzzle-ie 2 from 4 plates need to be pressed in order for a door to open).

Also:i dont want to use playerdistance order-i want to use a collision order but there is no command for this that can work with all actors-this is for player only.

Maybe i should post to the feature requests for a AddCollisionOrder for all actors.
User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Post by Juutis »

You need a '}' in the end of the pressure plate script.
Pain is only psychological.
Veleran
Posts: 891
Joined: Mon Aug 22, 2005 10:22 am
Location: Greece

Post by Veleran »

I knew after i post it-thanks a lot anyways-although i know very little of scripting,i m testing again with gravity on and off to see the results-i will post again later a new script.
Im trying to make the plate move up again with ForceUp.
User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Post by Juutis »

I think you should use flymove().
It's much better command for moving things around than the forces.
Pain is only psychological.
Veleran
Posts: 891
Joined: Mon Aug 22, 2005 10:22 am
Location: Greece

Post by Veleran »

I tried it and the computer freezes-dont know why.
I also tried scriptpoints-anyway i dont want the player only to control the plates because i will place any actor as weight for pressing the plate.
I mean i cant use the addcollisionorder and the playerdistorder commands-they re for the player only.
I m trying this now

{
Spawn[ ()
{
Console(true);
BoxWidth(30); // set bounding box width/depth
Gravity(false);
AvoidOrder("Avoidance");
NewOrder("Wait");
} ]

Wait[ ()
{
TeleportToPoint("Plate1_point1");
AddCollisionOrder("Pressed");
} ]

Pressed[ ()
{
TeleportToPoint("Plate1_point2");
SetEventState("Plate1Pressed", true);
DelCollisionOrder("Pressed");
AddCollisionOrder("Unpressed");
} ]

Unpressed[ ()
{
DelCollisionOrder("Unpressed");
TeleportToPoint("Plate1_point1");
SetEventState("Plate1Pressed", false);
NewOrder("Wait");
} ]
}
Post Reply