bobbing script
Posted: September 28th, 2005, 3:47 pm
Well i thought it was about time i had a go at scripting, but i'm a complete noob so i need some help lol. so far i've followed this tut to do bobbing http://www.modsonline.com/Tutorials-read-185.html except i used script_brushmodels, which works fine, but i also want to add another script_brushmodel to move side to side, but i'm not sure how you add another thread or whatever to make them both work together..here is the script i use for the bobbing:
main()
{
maps\mp\_load::main();
maps\mp\map_efx::main();
thread boatbobbing();
}
boatbobbing()
{
boat = getent("boat","targetname"); // Get the name of the script_model
wait (randomfloat (1.5)); // Generate a random Number of Seconds Between Bobbings
org = (-64, 96, 72); // Define Origin or Location of Your Boat/script_model
timer = 3; // Speed of the Bobbing - Higer Number Slower Bobbing
while (1)
{
boat moveto (org + (0,0,500), timer, timer*0.5, timer*0.5); // 2 is the number of units to go Above Original Location
wait (timer);
boat moveto (org + (0,0,-500), timer, timer*0.5, timer*0.5); // 2 is the number of units to go Below Original Location
wait (timer);
}
}
this works fine on its own, but how do i add a different scrip_brushmodel? i've tried adding this to it:
thread boatbobbing2();
}
boatbobbing()
{
boat2 = getent("boat","targetname"); // Get the name of the script_model
wait (randomfloat (1.5)); // Generate a random Number of Seconds Between Bobbings
org = (-64, 96, 72); // Define Origin or Location of Your Boat/script_model
timer = 3; // Speed of the Bobbing - Higer Number Slower Bobbing
while (1)
{
boat2 moveto (org + (300,0,0), timer, timer*0.5, timer*0.5); // 2 is the number of units to go Above Original Location
wait (timer);
boat2 moveto (org + (-300,0,0), timer, timer*0.5, timer*0.5); // 2 is the number of units to go Below Original Location
wait (timer);
}
}
but i get script compile error
what am i doing wrong?
main()
{
maps\mp\_load::main();
maps\mp\map_efx::main();
thread boatbobbing();
}
boatbobbing()
{
boat = getent("boat","targetname"); // Get the name of the script_model
wait (randomfloat (1.5)); // Generate a random Number of Seconds Between Bobbings
org = (-64, 96, 72); // Define Origin or Location of Your Boat/script_model
timer = 3; // Speed of the Bobbing - Higer Number Slower Bobbing
while (1)
{
boat moveto (org + (0,0,500), timer, timer*0.5, timer*0.5); // 2 is the number of units to go Above Original Location
wait (timer);
boat moveto (org + (0,0,-500), timer, timer*0.5, timer*0.5); // 2 is the number of units to go Below Original Location
wait (timer);
}
}
this works fine on its own, but how do i add a different scrip_brushmodel? i've tried adding this to it:
thread boatbobbing2();
}
boatbobbing()
{
boat2 = getent("boat","targetname"); // Get the name of the script_model
wait (randomfloat (1.5)); // Generate a random Number of Seconds Between Bobbings
org = (-64, 96, 72); // Define Origin or Location of Your Boat/script_model
timer = 3; // Speed of the Bobbing - Higer Number Slower Bobbing
while (1)
{
boat2 moveto (org + (300,0,0), timer, timer*0.5, timer*0.5); // 2 is the number of units to go Above Original Location
wait (timer);
boat2 moveto (org + (-300,0,0), timer, timer*0.5, timer*0.5); // 2 is the number of units to go Below Original Location
wait (timer);
}
}
but i get script compile error
