Page 1 of 2

script question

Posted: July 20th, 2006, 11:28 pm
by creator
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");

Posted: July 20th, 2006, 11:35 pm
by creator
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?

Posted: July 20th, 2006, 11:45 pm
by Luke

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.

Posted: July 21st, 2006, 12:28 am
by Drofder2004
^^ 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...

Posted: July 21st, 2006, 12:41 pm
by creator

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

Posted: July 21st, 2006, 2:52 pm
by Luke
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

Posted: July 21st, 2006, 3:39 pm
by creator
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

Posted: July 21st, 2006, 4:31 pm
by Luke
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.

Posted: July 21st, 2006, 5:49 pm
by creator
ok .. how to do it :) ?

Posted: July 21st, 2006, 6:46 pm
by Luke
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");
} 
}

Posted: July 21st, 2006, 7:36 pm
by creator
ok thx i test soon
luke do u wana test my map soon =\?
x fire milkshakee
msn creator-mapper@hotmail.com

Posted: July 21st, 2006, 10:52 pm
by creator
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)
********************

Posted: July 21st, 2006, 11:36 pm
by creator
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");
}
}

Posted: July 21st, 2006, 11:54 pm
by Drofder2004
make sure you c_jumps_move3 is in you map...

It cannot find that entity, so check it or remake it.

Posted: July 22nd, 2006, 12:12 am
by creator
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: