script question

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

Moderator: Core Staff

creator
CJ Worshipper
CJ Worshipper
Posts: 492
Joined: July 6th, 2006, 11:37 pm
Location: The Netherlands
Contact:

script question

Post by creator » July 20th, 2006, 11:28 pm

ok i made a script of a moving object
it moves correctly
but it look like it wait like 5 seconds till it goes again
what i need to do to change that?

Code: Select all

C_platform()
{
C_platform = getent ("c_jumps_move1","targetname");
while(1)
{
C_platform moveY (-184,2,1,0.5);
wait(1);
C_platform moveY (184,2,1,0.5);
C_platform waittill ("movedone");
do i need to change:

Code: Select all

C_platform()
{
C_platform = getent ("c_jumps_move1","targetname");
while(1)
{
C_platform moveY (-184,2,1,0.5);
wait(1);
C_platform moveY (184,2,1,0.5);
C_platform waittill ("movedone");
to:

Code: Select all

C_platform()
{
C_platform = getent ("c_jumps_move1","targetname");
while(1)
{
C_platform moveY (-184,0,1,0.5);
wait(1);
C_platform moveY (184,0,1,0.5);
C_platform waittill ("movedone");
Cod 1 Mapper&Modder&Moddeler

creator
CJ Worshipper
CJ Worshipper
Posts: 492
Joined: July 6th, 2006, 11:37 pm
Location: The Netherlands
Contact:

Post by creator » July 20th, 2006, 11:35 pm

and 2 of my moving objects doesnt move
i checked if it was script_brushmodel and if targetname was correct
they were correct,
how come they dont work
can it be cause i got 8 threads in a script?
6 works but the last 2 doesnt
do i need to transfer those 2 to a other script?
Cod 1 Mapper&Modder&Moddeler

Luke
Past/Inactive Team Member
Past/Inactive Team Member
Posts: 1774
Joined: May 31st, 2005, 12:42 am
Location: Cornwall, UK

Post by Luke » July 20th, 2006, 11:45 pm

Code: Select all

C_platform()
{
C_platform = getent ("c_jumps_move1","targetname");
while(1)
{
C_platform moveY (-184,0,1,0.5);
wait(1);
C_platform moveY (184,0,1,0.5);
C_platform waittill ("movedone");
I believe that would be wrong, as you're telling it to move 184 units in 0 seconds, and the last 2 numbers controls how it accelerates and slows down, which should equal the time set for it to move i think, which is 0 so you would have a problem with that.

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

Post by Drofder2004 » July 21st, 2006, 12:28 am

^^ Correct.

syntax:
moveX (<units>, <time>, <accel >, <decel>)

<accel> and <decel> must be equal or lower than <time>

so...

<accel> + <decel> =< <time> ;)
<accel> and <decel> are optional...
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

creator
CJ Worshipper
CJ Worshipper
Posts: 492
Joined: July 6th, 2006, 11:37 pm
Location: The Netherlands
Contact:

Post by creator » July 21st, 2006, 12:41 pm

Code: Select all

C_platform()
{
C_platform = getent ("c_jumps_move1","targetname");
while(1)
{
C_platform moveY (-190,1,0.5,0.5);
wait(1);
C_platform moveY (190,1,0.5,0.5);
C_platform waittill ("movedone");
that would work?
0.5+0.5 = 1


ok it works


can some 1 make me a small .map
with a script?
with in it:
1 platform and the rest to make the platform rotating?
so i can apply some of those to the map ( C_Jumps )

/edit
Cod 1 Mapper&Modder&Moddeler

Luke
Past/Inactive Team Member
Past/Inactive Team Member
Posts: 1774
Joined: May 31st, 2005, 12:42 am
Location: Cornwall, UK

Post by Luke » July 21st, 2006, 2:52 pm

Why don't you try it and see for yourself? if it doesn't work post again :roll:

To answer your question tho, 0.5 + 0.5 = 1 correct :P
Watch this before posting a question: http://www.albinoblacksheep.com/flash/posting.php

creator
CJ Worshipper
CJ Worshipper
Posts: 492
Joined: July 6th, 2006, 11:37 pm
Location: The Netherlands
Contact:

Post by creator » July 21st, 2006, 3:39 pm

wel...
i dont know how, i dont have a script, i cant make a own script
hmm
can u make me 1 :)?
takes like 5 mins for a pro like u :P
Cod 1 Mapper&Modder&Moddeler

Luke
Past/Inactive Team Member
Past/Inactive Team Member
Posts: 1774
Joined: May 31st, 2005, 12:42 am
Location: Cornwall, UK

Post by Luke » July 21st, 2006, 4:31 pm

I was referring to the script you already posted and asked if it would work..you must of edited it just before i posted, nvm.

I would like it if you could ask how to do it, rather than asking others to do it for you, otherwise you'll never learn.
Watch this before posting a question: http://www.albinoblacksheep.com/flash/posting.php

creator
CJ Worshipper
CJ Worshipper
Posts: 492
Joined: July 6th, 2006, 11:37 pm
Location: The Netherlands
Contact:

Post by creator » July 21st, 2006, 5:49 pm

ok .. how to do it :) ?
Cod 1 Mapper&Modder&Moddeler

Luke
Past/Inactive Team Member
Past/Inactive Team Member
Posts: 1774
Joined: May 31st, 2005, 12:42 am
Location: Cornwall, UK

Post by Luke » July 21st, 2006, 6:46 pm

To make a rotating platform? quite simple, make the platform that you want to rotate, then make a brush with the origin texture, the very center of this brush will be the pivot point where the platform rotates, then select both origin and platform brushes, right click go to script>brushmodel. Give it an appropriate targetname and thats the mapping part done.
The script you can use to make it rotate nonstop:

Code: Select all

platform_rotate() 
{ 
platform = getent("platform","targetname");  
while (1) 
{ 

platform rotateyaw(360, 5); //platform rotates 360 degrees on the z axis in 5 seconds

platform waittill("rotatedone");
} 
}

creator
CJ Worshipper
CJ Worshipper
Posts: 492
Joined: July 6th, 2006, 11:37 pm
Location: The Netherlands
Contact:

Post by creator » July 21st, 2006, 7:36 pm

ok thx i test soon
luke do u wana test my map soon =\?
x fire milkshakee
msn creator-mapper@hotmail.com
Cod 1 Mapper&Modder&Moddeler

creator
CJ Worshipper
CJ Worshipper
Posts: 492
Joined: July 6th, 2006, 11:37 pm
Location: The Netherlands
Contact:

Post by creator » July 21st, 2006, 10:52 pm

ok script compile error
i cannot seem to fix it
it was good befor i used ur script luke

server console:

Code: Select all

******* script runtime error *******
undefined is not an entity: (file 'maps\mp\c_jumps_movingobjects.gsc', line 39)
C_platform3 moveY (-190,1,0.5,0.5);

*
called from:
(file 'maps\mp\c_jumps_movingobjects.gsc', line 5)
thread C_platform3();

       *
called from:
(file 'maps\mp\c_jumps.gsc', line 6)
maps\mp\C_Jumps_movingobjects::main();

*
called from:
(file 'maps\mp\c_jumps.gsc', line 1)
main()

*
************************************
********************
ERROR: script runtime error
(see console for details)
********************
Cod 1 Mapper&Modder&Moddeler

creator
CJ Worshipper
CJ Worshipper
Posts: 492
Joined: July 6th, 2006, 11:37 pm
Location: The Netherlands
Contact:

Post by creator » July 21st, 2006, 11:36 pm

KillerSam wrote:You have made a mistake with the targetnames.
Make sure that the platform has the targetname: c_platform3, if that is the one you wish to use, and that in the script it has it defined with the line:

platform = getent("c_platform3","targetname");

then dont use c_platform3 in the script, use platform in the script to relate to the object, e.g as luke said.
first: when i remove the line: maps\mp\C_Jumps_rotatings::main(); from my gsc ( C_jumps.gsc )
and run the game there are no bugs
but when i add again i get those bugs
any idea why?

Code: Select all

main()
{
thread platform();
thread platform1();

}

platform()
{
platform = getent("C_jumps_rotate","targetname"); 
while (1)
{

platform rotateyaw(360, 5);

platform waittill("rotatedone");
}
}

platform1()
{
platform1 = getent("C_jumps_rotate2","targetname"); 
while (1)
{

platform1 rotateyaw(360, 5);

platform1 waittill("rotatedone");
}
}
target names work...
so.. WTF lol

Code: Select all

******* script runtime error *******
undefined is not an entity: (file 'maps\mp\c_jumps_movingobjects.gsc', line 39)
C_platform3 moveY (-190,1,0.5,0.5);

*
called from:
(file 'maps\mp\c_jumps_movingobjects.gsc', line 5)
thread C_platform3();

       *
called from:
(file 'maps\mp\c_jumps.gsc', line 6)
maps\mp\C_Jumps_movingobjects::main();

*
called from:
(file 'maps\mp\c_jumps.gsc', line 1)
main()

Code: Select all

C_platform3()
{
C_platform3 = getent ("c_jumps_move3","targetname");
while(1)
{
C_platform3 moveY (-190,1,0.5,0.5);
wait(1);
C_platform3 moveY (190,1,0.5,0.5);
C_platform3 waittill ("movedone");
}
}
Cod 1 Mapper&Modder&Moddeler

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

Post by Drofder2004 » July 21st, 2006, 11:54 pm

make sure you c_jumps_move3 is in you map...

It cannot find that entity, so check it or remake it.
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

creator
CJ Worshipper
CJ Worshipper
Posts: 492
Joined: July 6th, 2006, 11:37 pm
Location: The Netherlands
Contact:

Post by creator » July 22nd, 2006, 12:12 am

omfg i think i know why its bad
befor i made the new rotating script + brushmodel and those...
i removed 6 platoforms ( those were the c_jumps_move 3 to 8 )
lmao embarecing
dont close yet i might got new questions or bugs or something else... lol
sorry :oops: :oops: :oops: :oops:
Cod 1 Mapper&Modder&Moddeler

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests