werid bug

Topics regarding Scripting with Reality Factory
Post Reply
The_ErAdictor
Posts: 11
Joined: Thu Feb 16, 2006 10:34 am

werid bug

Post by The_ErAdictor »

well hi,
well this bug has got me baffled i cant get the simplest bot to work
IDLE [Idle]
WALK [Walk]

FOV [360]
SIGHTDIST [100000]
DAMAGEATTRIBUTE [Health]
ROTATESPEED [150]
MOVESPEED [1500]
FIREX [0]
FIREY [0]
FIREZ [0]

Start[()
{
console(bool True);
Setgroup(Allied);
Setattribute(char*Health, int 100);
SetFOV(FOV);
BoxWidth(50);
Targetgroup (Enemy);
neworder (findtarget)
) }

findtarget[()
{
FindTargetorder(float SIGHTDIST, char*foundtarget, char*DAMAGEATTRIBUTE);
} ]


{
foundtarget[()
{
setweapon (char*Erifle);
MoveToTarget(char*WALK, float MOVESPEED);
RotateToTarget(char*IDLE, float ROTATESPEED);
lowlevel(char*Damage&Die);
} ]


{
Damage&Die[()
{
UpdateEnemyVis();
UpdateTarget();
FireProjectile(char*Erifle_B,char*Bip01 R Hand ,float FIREX, float FIREY, float FIREZ, Char*Health);
HighLevel (char*findtarget);
} ]
its supposed to look for an "enemy" and goto it and fire its gun and repeat but it doesnt work as the picture shows????????????!!!!!!!!!!!!!
Attachments
untitled.jpg
(60.2 KiB) Downloaded 78 times
The World is your oyster!
Eat it good!!!!
shadow
Posts: 81
Joined: Mon Jul 25, 2005 5:37 am

Post by shadow »

You have so many errors its hard to begin.

All scripts need opening and closing braces which you are missing.
{
   body of script;
}

Also, all of your references to bool, char*, int etc have to be removed.
They are there to tell you the type of value thats expected.

Your Start order has an extra bracket ) and is missing a closing square bracket ]

Also the line ...neworder (findtarget)
should be... neworder("findtarget"); - note the quotes needed and the semicolon

Do not use reserved characters such as '&' symbol for order names!

To get you on the right track I would suggest you read Pickles RF e-book (I believe its free to download now)
He has a great section on scripting.

Hope this helps and good luck. Lots of errors but don't give up ;)

Try a simple script like this, then keep building on it one step at a time.
This script works with the virgil act file
It does nothing but Stand idle and rotates left and right.
Its a good starting point to buils on.

{
SCALE [1.5] // scale of actor
BOXWIDTH [0] // width and depth of bounding box

HEALTHATTRIBUTE [health] // name of health attribute
HEALTH [50] // initial amount of health

YAWSPEED [100] // speed of rotation in deg/sec


// idling and turning

IDLE [Idle] // idle animation
TURNL [Idle] // turn left animation
TURNR [Idle] // turn right animation

FOV [360]
SIGHTDIST [100000]


// spawn pawn

Start[ ()
{
Console(true);
Scale(SCALE); // scale the actor
SetFOV(FOV); // set field of view

NewOrder("Idle");
} ]


// idle in place waiting for something to happen

Idle[ ()
{
PlayAnimation(IDLE, true, "");

if(random(1,10)>6)
{
if(random(1,10)>5)
{
Rotate(TURNL, 102, 0, 90, 0, "");
PlayAnimation(IDLE, true, "");
Rotate(TURNR, 108, 0, -90, 0, "");
}
else
{
Rotate(TURNR, 108, 0, -90, 0, "");
PlayAnimation(IDLE, true, "");
Rotate(TURNL, 102, 0, 90, 0, "");
}
}
RestartOrder();
} ]

}
Post Reply