Page 1 of 1

Scripting help

Posted: November 28th, 2013, 5:57 pm
by jeffskye
hi guys
i started making maps few weeks ago but i now wanna try more scritping :D
i made a test map for jump pads and i also made a script but i get a error everytime again and again can someone of you guys
check this script and edit it so it works?
would be awesome !

Code: Select all

main()
{
        maps\mp\_load::main();
 
        game["allies"] = "sas";
        game["axis"] = "russian";
        game["attackers"] = "axis";
        game["defenders"] = "allies";
        game["allies_soldiertype"] = "woodland";
        game["axis_soldiertype"] = "woodland";
 
        setdvar( "r_specularcolorscale", "1" );
        thread jumper();
}
 
jumper()
{
        jumpx = getent ("jump","targetname");
        glow = getent ("glow","targetname");
        air1 = getent ("air1","targetname");
        air2 = getent ("air2","targetname");
        air3 = getent ("air3","targetname");
        air4 = getent ("air4","targetname");
 
        level._effect[ "beacon_glow" ] = loadfx( "misc/ui_pickup_available" );
        maps\mp\_fx::loopfx("beacon_glow", (glow.origin), 3, (glow.origin) + (0, 0, 90));
 
        time = 1;
        for(;;)
        {
                jumpx waittill ("trigger",user);
                if (user istouching(jumpx))
                {
                        //throw = user.origin + (100, 100, 0);
                        air = spawn ("script_model",(0,0,0));
                        air.origin = user.origin;
                        air.angles = user.angles;
                        user linkto (air);
                        air moveto (air1.origin, time);
                        wait 1;
                        air moveto (air2.origin, time);
                        wait .5;
                        air moveto (air3.origin, time);
                        wait .5;
                        air moveto (air4.origin, time);
                        wait 1;
                        user unlink();
                        wait 1;
                }
        }
}
Thank you :)

Re: Scripting help

Posted: December 21st, 2013, 9:19 pm
by Drofder2004
Why are you checking if the user ittouching on the trigger?
If you want the player to trigger the trigger script from touching, you should use a trigger_multiple.


"user.angles" should be "user getPlayerAngles();".

You also need "air enablelinkto();"

Add those few things and let us know if there are any errors.

Re: Scripting help

Posted: December 22nd, 2013, 12:14 am
by F |Madness| U
Drofder2004 wrote:
"user.angles" should be "user getPlayerAngles();".
Just wondering, why is this necessary? Do they not hold the same value? Because if you want to get the angles of an entity rather than a player, you have to use entity.angles since you can't do entity getPlayerAngles(), right?

Re: Scripting help

Posted: December 22nd, 2013, 5:21 am
by Nekoneko
.angles will only return the angles of the collision cylinder, leaving out the x value (player looking up/down)

Re: Scripting help

Posted: December 22nd, 2013, 4:55 pm
by F |Madness| U
I see, thanks for clearing that up for me.