scripting
Moderator: Core Staff
-
- CJ Wannabe
- Posts: 33
- Joined: July 26th, 2005, 2:55 am
- Contact:
scripting
I need help with scripting… Iv been trying to do a script on my map where ill have sliding brushes like on jm_woop when the thing goes up and down on no command…
But I want my to go horizontal and I want more then one and each one goes in a deferent directions. Its proble something simple but im not that good at scripting, just started.
If anyone knows of any web sites that has good scripting lesions or if u can give me one right here that would be great… and don’t give me modsonline.com already looked at that one
But I want my to go horizontal and I want more then one and each one goes in a deferent directions. Its proble something simple but im not that good at scripting, just started.
If anyone knows of any web sites that has good scripting lesions or if u can give me one right here that would be great… and don’t give me modsonline.com already looked at that one
-
- Past/Inactive Team Member
- Posts: 2159
- Joined: May 10th, 2005, 11:02 pm
- Location: Tha A.T.L Baby ;)
http://dynamic.gamespy.com/%7Emap/callo ... hp?act=idx
theres a link to the .map forums, a complete mapping community .. check the section for cod scripting
i dont no if this will work, but open up jm_wOOp and look at the brush that moves up and down, and maybe theres a way through entities to make it move side to side? play around with it and i will as well.. also post in those forums about help, and they have some serious gamers/mappers in there .. good luck with it..
Murphy
theres a link to the .map forums, a complete mapping community .. check the section for cod scripting
i dont no if this will work, but open up jm_wOOp and look at the brush that moves up and down, and maybe theres a way through entities to make it move side to side? play around with it and i will as well.. also post in those forums about help, and they have some serious gamers/mappers in there .. good luck with it..
Murphy
-
- Past/Inactive Team Member
- Posts: 266
- Joined: January 16th, 2005, 10:52 am
- Location: Cambridge/Hull, UK
- Contact:
Easy to make it go to side to side, use a script like this:
main()
{ thread moving_platform(); }
moving_platform()
{
platform = getent("platform","targetname");
wait (randomfloat (1.5));
org = (0, 0, 0);
timer = 1.5;
while (1)
{
platform moveto (org + (0,90,0), timer, timer*0.5, timer*0.5);
wait (timer);
platform moveto (org + (0,-90,0), timer, timer*0.5, timer*0.5);
wait (timer);
}
}
You have to make the brush that you want to move a script_brushmodel. Then have to give it the targetname, I used "platform" in the example, but you can use whatever name you like, just change it in the script. The values like (0,90,0) and the x, y and z axis. The first value makes the platform go up and down, second makes it go left to right, and the third is away and towards you. Make sure the first value and the second value where it is minus - are the same, otherwise the platform will gradually move away . The time*0.5 is the time it takes for the platform to come back the other way, so the platform will stop for half a second, then come back, so you can change that to any value in seconds. Finally, where I have used 90 and -90, thats how many units the platform moves, 90 units left, and then 90 makes it go 90 units right. Hope that helps, if ive explained badly, i'll try and explain better :S
main()
{ thread moving_platform(); }
moving_platform()
{
platform = getent("platform","targetname");
wait (randomfloat (1.5));
org = (0, 0, 0);
timer = 1.5;
while (1)
{
platform moveto (org + (0,90,0), timer, timer*0.5, timer*0.5);
wait (timer);
platform moveto (org + (0,-90,0), timer, timer*0.5, timer*0.5);
wait (timer);
}
}
You have to make the brush that you want to move a script_brushmodel. Then have to give it the targetname, I used "platform" in the example, but you can use whatever name you like, just change it in the script. The values like (0,90,0) and the x, y and z axis. The first value makes the platform go up and down, second makes it go left to right, and the third is away and towards you. Make sure the first value and the second value where it is minus - are the same, otherwise the platform will gradually move away . The time*0.5 is the time it takes for the platform to come back the other way, so the platform will stop for half a second, then come back, so you can change that to any value in seconds. Finally, where I have used 90 and -90, thats how many units the platform moves, 90 units left, and then 90 makes it go 90 units right. Hope that helps, if ive explained badly, i'll try and explain better :S
-
- CJ Wannabe
- Posts: 33
- Joined: July 26th, 2005, 2:55 am
- Contact:
-
- CJ Wannabe
- Posts: 33
- Joined: July 26th, 2005, 2:55 am
- Contact:
-
- CJ Wannabe
- Posts: 33
- Joined: July 26th, 2005, 2:55 am
- Contact:
-
- Past/Inactive Team Member
- Posts: 267
- Joined: February 9th, 2005, 5:32 pm
- Location: Fat
- Contact:
I didnt really read any of this. But http://www.modsonline.com, read a few of the scripts, then practice making your own, and eventually you will understand how it all works.
The real question is what is the question?
-
- CJ Wannabe
- Posts: 33
- Joined: July 26th, 2005, 2:55 am
- Contact:
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Personally, Noodle's way is strange (I think Noodle has a bit more knowledge of scripting than me )GoatFarmer wrote:Hey Noodle,
can u make the same script but with 2 brushes moveing at the same time so i can see how it is done
That would be great
Thanks.
I wouldn't use timer, org and I have never used "randomfloat" (as I have no idea what it does, although a guess says it starts in a random place between 0 and 90)
This is how I would've done it...
Code: Select all
main()
{
thread moving_platform();
thread moving_platform2();
}
moving_platform()
{
platform = getent("platform","targetname");
while (1)
{
platform move? (%, #, #*0.5, #*0.5);
platform waittill ("movedone");
platform move? (%, #, #*0.5, #*0.5);
platform waittill ("movedone");
}
moving_platform2()
{
platform2 = getent("platform2","targetname");
while (1)
{
platform2 move? (%, #, #*0.5, #*0.5);
platform2 waittill ("movedone");
platform2 move? (%, #, #*0.5, #*0.5);
platform2 waittill ("movedone");
}
}
% = Distance of movement in specified direction
# = time taken to get from a to b
The way I done it is not the most practical (using 2 threads) but atm, my PC has just suffered a trauma and I cant do any testing of scripts until 2moro.
Also check out this Tutorial for more help on what you can do with moving things.
Here
Last edited by Drofder2004 on August 12th, 2005, 8:01 pm, edited 1 time in total.
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
-
- Past/Inactive Team Member
- Posts: 266
- Joined: January 16th, 2005, 10:52 am
- Location: Cambridge/Hull, UK
- Contact:
GoatFarmer, go with Drofders script
And about jm_legend, I doubt it is going to get finished tbh, mostly my fault I must say. I just dont seem to have the patience to sit there and map stuff anymore, and have been trying to make one uber complex part of the map for ages and it damn wont work. When destiny gets back, we'll see what happens, I might have made loads of stuff by then out of boredom lol.
And about jm_legend, I doubt it is going to get finished tbh, mostly my fault I must say. I just dont seem to have the patience to sit there and map stuff anymore, and have been trying to make one uber complex part of the map for ages and it damn wont work. When destiny gets back, we'll see what happens, I might have made loads of stuff by then out of boredom lol.
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Who is online
Users browsing this forum: No registered users and 38 guests