a script for cj map
Moderator: Core Staff
a script for cj map
I need a script that will absolutely not let you save unless you are COMPLETELY stopped. I have a few problems though. I am not new to coding, but i am new to scripting. Where should i store the text file? how would i make a script that does this? I have no idea where to start, please help.
-pcbouncer
-pcbouncer
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: a script for cj map
How would you describe completely stopped?
You could create a script that tracks the players origin every 2 seconds, if the origin does not change, you assign a value of "player.notmoving = true" and use that in the save loop, making sure to reset it when they move.
What exactly is the purpose of the script?
You could create a script that tracks the players origin every 2 seconds, if the origin does not change, you assign a value of "player.notmoving = true" and use that in the save loop, making sure to reset it when they move.
What exactly is the purpose of the script?

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
Re: a script for cj map
There are surface types that are ice. They allow you to slide and unfortunately i don't want them to be able to save until they've stopped (to make it harder) otherwise they can save right as they get to the platform, even if they are moving. When they load, they load completely still.
So, i am confused at the stuff you mentioned, although it does make sense. Could you explain how someone would go about this?
Could you just make an if statement that stated if they are moving, saving = false, else, save = true?
So, i am confused at the stuff you mentioned, although it does make sense. Could you explain how someone would go about this?
Could you just make an if statement that stated if they are moving, saving = false, else, save = true?
Re: a script for cj map
Also i might want a 1 second wait time before they can save, after they've stopped.
Re: a script for cj map
I just realized what you were saying. I am new to scripting for cod4, maybe show a little of the script you were thinking of. I don't have any idea where to store the .gsc file and i don't understand how it will stay inside the map.
-
- Core Staff
- Posts: 2030
- Joined: July 24th, 2006, 11:21 am
- Location: Cramped in a small cubicle/making another jump map
Re: a script for cj map
Code: Select all
check_movement()
{
    THRESH = 20;
    WAIT_TIME = 0.5;
   Â
    diff = [];
    old_origin = [];
    for(i=0;i<3;i++)
    {
        diff[i] = 0;
        old_origin[i] = self.origin[i];
    }
   Â
    while(1)
    {
        has_moved = false;
       Â
        for(i=0;i<3;i++) //if you only need X and Y movement, use i<2
        {
            diff[i] = old_origin[i] - self.origin[i];
            if(abs(diff[i])>THRESH)
                has_moved = true;
            old_origin[i] = self.origin[i];
        }
       Â
        if(has_moved)
            iprintlnbold("player moved by more than "+THRESH+" units.");
       Â
        wait WAIT_TIME;
    }
}
abs(n)
{
    if(n<0)
        return n*-1;
    return n;
}
Google the other stuff.
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
Re: a script for cj map
Alot of it is confusing, but where would i put the .gsc file??
Re: a script for cj map
also im not sure if it worked, i tried testing it
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: a script for cj map
This is only a detection code, Rezil has not provided you with all of the working mechanics.

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
Re: a script for cj map
so confused about map scripting
-
- Core Staff
- Posts: 2030
- Joined: July 24th, 2006, 11:21 am
- Location: Cramped in a small cubicle/making another jump map
Re: a script for cj map
What exactly do you want us to do for you? I've provided you with an example, there are loads of beginner scripting tutorials for codscript, there's lots of code in your stock CoD files you can go through, there's a shitload of websites that help users with their mapping/scripting problems(this being one of the better ones in my opinionpcbouncer wrote:so confused about map scripting

If you're not willing to invest your time to figure some basic stuff for yourself, I'm not willing to invest my time to do it for you.
http://lmgtfy.com/?q=cod+scripting+tutorial
viewtopic.php?f=19&t=4011
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
Who is online
Users browsing this forum: No registered users and 2 guests