Scripting help

Tutorials for Call of Duty 4 mapping

Moderator: Core Staff

Post Reply
jeffskye
CJ Wannabe
CJ Wannabe
Posts: 1
Joined: November 28th, 2013, 5:48 pm

Scripting help

Post by jeffskye » November 28th, 2013, 5:57 pm

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 :)
Last edited by Drofder2004 on December 21st, 2013, 9:09 pm, edited 2 times in total.
Reason: [code=cod]

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Scripting help

Post by Drofder2004 » December 21st, 2013, 9:19 pm

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.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

F |Madness| U
CJ G0D!
CJ G0D!
Posts: 1575
Joined: June 3rd, 2009, 9:02 pm
Location: Cardiff University, UK

Re: Scripting help

Post by F |Madness| U » December 22nd, 2013, 12:14 am

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?
-

Nekoneko
CJ Fan
CJ Fan
Posts: 170
Joined: April 18th, 2011, 3:48 pm

Re: Scripting help

Post by Nekoneko » December 22nd, 2013, 5:21 am

.angles will only return the angles of the collision cylinder, leaving out the x value (player looking up/down)

F |Madness| U
CJ G0D!
CJ G0D!
Posts: 1575
Joined: June 3rd, 2009, 9:02 pm
Location: Cardiff University, UK

Re: Scripting help

Post by F |Madness| U » December 22nd, 2013, 4:55 pm

I see, thanks for clearing that up for me.
-

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests