scripting

Have questions about CoD/UO mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

GoatFarmer
CJ Wannabe
CJ Wannabe
Posts: 33
Joined: July 26th, 2005, 2:55 am
Contact:

scripting

Post by GoatFarmer » August 11th, 2005, 3:48 am

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

User avatar
MuRpHy*
Past/Inactive Team Member
Past/Inactive Team Member
Posts: 2159
Joined: May 10th, 2005, 11:02 pm
Location: Tha A.T.L Baby ;)

Post by MuRpHy* » August 11th, 2005, 4:19 am

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 :P.. good luck with it..


Murphy
Image
Image

User avatar
Noodle
Past/Inactive Team Member
Past/Inactive Team Member
Posts: 266
Joined: January 16th, 2005, 10:52 am
Location: Cambridge/Hull, UK
Contact:

Post by Noodle » August 11th, 2005, 1:29 pm

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 :D. 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

GoatFarmer
CJ Wannabe
CJ Wannabe
Posts: 33
Joined: July 26th, 2005, 2:55 am
Contact:

Post by GoatFarmer » August 11th, 2005, 4:45 pm

Thanks man helps a lot. :D

User avatar
MuRpHy*
Past/Inactive Team Member
Past/Inactive Team Member
Posts: 2159
Joined: May 10th, 2005, 11:02 pm
Location: Tha A.T.L Baby ;)

Post by MuRpHy* » August 11th, 2005, 4:57 pm

noodle knows what hes doing :P.. btw noodle, how is jm_legend going? was supposed to be out late july, its now august :P when destiny gets back, get cracking :P lol
Image
Image

GoatFarmer
CJ Wannabe
CJ Wannabe
Posts: 33
Joined: July 26th, 2005, 2:55 am
Contact:

Post by GoatFarmer » August 11th, 2005, 5:02 pm

Now im wondering how to make 2 brushes move from one script… I got the script that you made me to work but now I want 2 of them to move in different directions.

User avatar
MuRpHy*
Past/Inactive Team Member
Past/Inactive Team Member
Posts: 2159
Joined: May 10th, 2005, 11:02 pm
Location: Tha A.T.L Baby ;)

Post by MuRpHy* » August 11th, 2005, 5:07 pm

just make another description, except change the timing (because if im not mistaken you want one to go one way while the other is going another way and then back again) because they just have to be goign at the same time :P
Image
Image

GoatFarmer
CJ Wannabe
CJ Wannabe
Posts: 33
Joined: July 26th, 2005, 2:55 am
Contact:

Post by GoatFarmer » August 11th, 2005, 6:35 pm

i get a script comiple error when i try that murphy

User avatar
MuRpHy*
Past/Inactive Team Member
Past/Inactive Team Member
Posts: 2159
Joined: May 10th, 2005, 11:02 pm
Location: Tha A.T.L Baby ;)

Post by MuRpHy* » August 11th, 2005, 6:58 pm

hmm... well than i dont exactly know, talk to drofder about mapping, thats his best thing ;)
Image
Image

User avatar
Plazma
Past/Inactive Team Member
Past/Inactive Team Member
Posts: 267
Joined: February 9th, 2005, 5:32 pm
Location: Fat
Contact:

Post by Plazma » August 11th, 2005, 7:52 pm

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?

Image

GoatFarmer
CJ Wannabe
CJ Wannabe
Posts: 33
Joined: July 26th, 2005, 2:55 am
Contact:

Post by GoatFarmer » August 12th, 2005, 12:13 am

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 :wink:

Thanks.

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

Post by Drofder2004 » August 12th, 2005, 5:49 am

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 :wink:

Thanks.
Personally, Noodle's way is strange (I think Noodle has a bit more knowledge of scripting than me :P)
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");
}
}
? = xyz depending on direction of movement
% = 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.
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

User avatar
Noodle
Past/Inactive Team Member
Past/Inactive Team Member
Posts: 266
Joined: January 16th, 2005, 10:52 am
Location: Cambridge/Hull, UK
Contact:

Post by Noodle » August 12th, 2005, 7:51 pm

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.

Pedsdude
Site Admin
Site Admin
Posts: 15909
Joined: October 15th, 2004, 7:18 pm
Location: UK

Post by Pedsdude » August 12th, 2005, 11:20 pm

Whenever I try using scripts they just fail miserably (apart from fire, that works fine ;)).
Image
Image

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

Post by Drofder2004 » August 12th, 2005, 11:50 pm

Pedsdude wrote:Whenever I try using scripts they just fail miserably (apart from fire, that works fine ;)).
You suck :P

Its extremely easy tbh :D
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

Post Reply

Who is online

Users browsing this forum: No registered users and 38 guests