script problem

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

Moderator: Core Staff

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

script problem

Post by creator » December 16th, 2006, 4:09 pm

im trying to link a trigger to a platform
but i keep getting a error:

Code: Select all

array is not an entity: (file 'maps\mp\jump.gsc', line 20)
spinners_trig linkto(spinners);

*
called from:
(file 'maps\mp\jump.gsc', line 4)
thread spins();

       *
called from:
(file 'maps\mp\jump.gsc', line 1)
main()
this is my script.

Code: Select all

main()
{
maps\mp\_load::main(); 
thread spins();
}

spins()
{
spinners = getent ("spinners","targetname");
spinners1 = getent ("spinners1","targetname");
spinners2 = getent ("spinners2","targetname");
spinners3 = getent ("spinners3","targetname");
spinners4 = getent ("spinners4","targetname");
spinners_trig = getentarray ("spinners_trig","targetname");
spinners1_trig = getentarray ("spinners_trig1","targetname");
spinners2_trig = getentarray ("spinners_trig2","targetname");
spinners3_trig = getentarray ("spinners_trig3","targetname");
spinners4_trig = getentarray ("spinners_trig4","targetname");
spinners_trig linkto(spinners);
spinners_trig1 linkto(spinners1);
spinners_trig2 linkto(spinners2);
spinners_trig3 linkto(spinners3);
spinners_trig4 linkto(spinners4);
while (1)
{
spinners rotateto ((0, 0, 360), 3);
spinners1 rotateto ((0, 0, 360), 3);
spinners2 rotateto ((0, 0, 360), 3);
spinners3 rotateto ((0, 0, 360), 3);
spinners4 rotateto ((0, 0, 360), 3);
}
}
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 » December 16th, 2006, 4:53 pm

What are your triggers doing? you have = getentarray for each trigger, thats basically what the error is about, as you haven't setup an array. You also need enablelinkto(); to be able to link triggers..spinners_trig enablelinkto(); ect.
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 » December 16th, 2006, 6:29 pm

get this error:

Code: Select all

entity (classname: 'trigger_multiple') does not currently support linkTo: (file 'maps\mp\jump.gsc', line 19)
spinners_trig linkto(spinners);

Code: Select all

main() 
{ 
maps\mp\_load::main(); 
thread spins(); 
} 

spins() 
{ 
spinners = getent ("spinners","targetname"); 
spinners1 = getent ("spinners1","targetname"); 
spinners2 = getent ("spinners2","targetname"); 
spinners3 = getent ("spinners3","targetname"); 
spinners4 = getent ("spinners4","targetname"); 
spinners_trig = getent ("spinners_trig","targetname"); 
spinners1_trig = getent ("spinners_trig1","targetname"); 
spinners2_trig = getent ("spinners_trig2","targetname"); 
spinners3_trig = getent ("spinners_trig3","targetname"); 
spinners4_trig = getent ("spinners_trig4","targetname"); 
spinners_trig enablelinkto();
spinners1_trig enablelinkto();
spinners2_trig enablelinkto();
spinners3_trig enablelinkto();
spinners4_trig enablelinkto();
spinners_trig linkto(spinners); 
spinners1_trig linkto(spinners1);
spinners2_trig linkto(spinners2);
spinners3_trig linkto(spinners3);
spinners4_trig linkto(spinners4);
while (1) 
{ 
spinners rotateto ((0, 0, 360), 3); 
spinners1 rotateto ((0, 0, 360), 3); 
spinners2 rotateto ((0, 0, 360), 3); 
spinners3 rotateto ((0, 0, 360), 3); 
spinners4 rotateto ((0, 0, 360), 3); 
} 
}

atm i dont want the trigger to do anything but soon i want them to teleport a player.
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 » December 16th, 2006, 10:45 pm

Try this, but its untested..give all the spinners a targetname of spinner, and triggers spinner_trig.

Code: Select all

main()
{
maps\mp\_load::main();
thread spin();
} 

spin()
{
spinner = getentarray("spinner","targetname");
spinner_trig = getentarray("spinner_trig","targetname");

for(i=0;i<spinner.size;i++)
for(i=0;i<spinner_trig.size;i++)
{
  spinner[i] thread spinners();
  spinner_trig[i] thread spin_trig();
}
}

spinners()
{
while(1)
{
  self rotateto ((0, 0, 360), 3); 
}
}

spin_trig()
{
self enablelinkto();
self linko(spinner);
while(1)
{
self waittill ("trigger",user);
user setOrigin ((0, 0, 0)); //add co-ords here
wait 1;  
}
}
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 » December 17th, 2006, 12:27 am

that script worked [except instead linkto u had written linko]
but gave error like infinity loop so i added
self waittill ("rotatedone");
but now i get a error

Code: Select all

not an entity: (file 'maps\mp\test.gsc', line 32)
self linkto(spinner);

            *
called from:
(file 'maps\mp\test.gsc', line 16)
  spinner_trig[i] thread spin_trig();

                         *
called from:
(file 'maps\mp\test.gsc', line 4)
thread spin();

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

Code: Select all

main()
{
maps\mp\_load::main();
thread spin();
} 

spin()
{
spinner = getentarray("spinner","targetname");
spinner_trig = getentarray("spinner_trig","targetname");

for(i=0;i<spinner.size;i++)
for(i=0;i<spinner_trig.size;i++)
{
  spinner[i] thread spinners();
  spinner_trig[i] thread spin_trig();
}
}

spinners()
{
while(1)
{
  self rotateto ((0, 0, 360), 3); 
  self waittill ("rotatedone");
}
}

spin_trig()
{
self enablelinkto();
self linkto(spinner);
while(1)
{
self waittill ("trigger",user);
user setOrigin ((0, 0, 0));
wait 1;  
}
}
Cod 1 Mapper&Modder&Moddeler

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

Post by Drofder2004 » December 17th, 2006, 12:36 am

You have spinner in your third function, but no reference to it anywhere else... try the following.

Code: Select all

main()
{
maps\mp\_load::main();
thread spin();
}

spin()
{
spinner = getentarray("spinner","targetname");
spinner_trig = getentarray("spinner_trig","targetname");

for(i=0;i<spinner.size;i++)
for(i=0;i<spinner_trig.size;i++)
{
  spinner[i] thread spinners();
  spinner_trig[i] thread spin_trig(spinner[i]);
}
}

spinners()
{
while(1)
{
  self rotateto ((0, 0, 360), 3);
  self waittill ("rotatedone");
}
}

spin_trig(spinner)
{
self enablelinkto();
self linkto(spinner);
while(1)
{
self waittill ("trigger",user);
user setOrigin ((0, 0, 0));
wait 1; 
}
}
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 » December 17th, 2006, 12:50 am

the script is working [ i think ]
but it crashes my game for a reason. there are no errors but.. just crash
Cod 1 Mapper&Modder&Moddeler

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

Post by Drofder2004 » December 17th, 2006, 1:02 am

Ok, new idea...

Listen carefully and follow instructions exactly...

Select ALL the entities (spinner's and spinner_trig's). [Make sure you hold ALT+SHIFT while selecting them]
Now, right-click the 2D window and select "Ungroup Entity".

All of your entities have now been removed and you are simply left with brushes.
Now, remake ALL of those entities, bu tthis time do not give them targetnames, just make them either a script_<whatever> or a trigger_<whatever>.

Ok, now select all the spinner_trig's and open the entity window (n).
Give them a targetname with value "spinner_trig".
Now, select the first spinner_trig. Then select the corresponding "Spinner" (this should not have a targetname).
Then press 'W', hopefully you should have a line connecting the first spinner_trig with the correct 'spinner' (which will now have a targetname of "auto01" (or similar).

do this for ALL of the remaining spinners and triggers (make sure the spinner_trig is selected first, and the spinner second). Once this is complete, try the following code...

Code: Select all

main()
{
maps\mp\_load::main();
thread spin();
}

spin()
{
spinner_trig = getentarray("spinner_trig","targetname");

for(i=0;i<spinner_trig.size;i++)
{
   spinner_trig[i].target thread spinners();
   spinner_trig[i] thread spin_trig();
}

spinners()
{
while(1)
{
  self rotateto ((0, 0, 360), 3);
  self waittill ("rotatedone");
}
}

spin_trig()
{
self enablelinkto();
self linkto(self.target);
while(1)
{
self waittill ("trigger",user);
user setOrigin ((0, 0, 0));
wait 1;
}
}
report any error.
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 » December 17th, 2006, 1:09 am

1. i get a compile error after 30 seconds game started, [from akk mod]
2. the spinners arent spinning but they teleport,
3. done it all but not spinning and seems like its conflicting with akk mod.
Cod 1 Mapper&Modder&Moddeler

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

Post by Drofder2004 » December 17th, 2006, 1:14 am

Try this code...

Code: Select all

main()
{
maps\mp\_load::main();
thread spin();
}

spin()
{
spinner_trig = getentarray("spinner_trig","targetname");

for(i=0;i<spinner_trig.size;i++)
{
   getent(spinner_trig[i].target,"targetname") thread spinners();
   spinner_trig[i] thread spin_trig();
}

spinners()
{
while(1)
{
  self rotateto ((0, 0, 360), 3);
  self waittill ("rotatedone");
}
}

spin_trig()
{
self enablelinkto();
self linkto(self.target);
while(1)
{
self waittill ("trigger",user);
user setOrigin ((0, 0, 0));
wait 1;
}
}
And put up the akk mod error.
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 1 guest