scipt belt help

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

Moderator: Core Staff

Post Reply
User avatar
{JUMPER}Alfio
CJ Wannabe
CJ Wannabe
Posts: 9
Joined: June 28th, 2010, 2:02 pm

scipt belt help

Post by {JUMPER}Alfio » December 11th, 2011, 1:35 pm

Hello everyone I need help to put a conveyor belt like this (http://www.youtube.com/watch?v=JBtc9OJiUUE) on my map who can help me?

User avatar
Goro92
CJ Spammer!
CJ Spammer!
Posts: 605
Joined: March 7th, 2011, 5:54 pm
Location: Brescia, Italy

Re: scipt belt help

Post by Goro92 » December 11th, 2011, 3:03 pm

Ciao Alfio!

Hi know him and he's italian so i explain this in ita

Allora io ho creato qualcosa di simile usando questo codice

Code: Select all

 
 
main()
{
thread startbelts();
 
}
 
startbelts()
{
   belts = getEntArray("belt", "targetname");
 
   for (j = 0; j < belts.size; j++)
   {
      belts[j] thread belt();
      wait .1;
   }
}   
 
belt()
{
   while(1)
   {
      self moveTo((1000, 1000, 1000), .1);
      wait .1;
      self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
      self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
      self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
      self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
      self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
      self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
      self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
      self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
      self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
      self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
      self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
      self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
      self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
       self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
      self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
      self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
      self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
      self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
      self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
      self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
      self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
      self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
      self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
      self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
      self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
      self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
      self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
      self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
      self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
      self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
       self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
      self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
      self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
      self moveTo((self.origin+(32, 0, 0)), .1);
      wait .1;
     
      self.origin = (1032, 1000, 1000);
   }
}
quello che devi fare in codradiant è creare tanti sciptbrushmodel( io ad esempio ne ho creati 35) di larghezza 32 (se vuoi cambiare la larghezza ricorda però di cambiarla anche nel codice ...tipo se vuoi farli di 40 metti self moveTo((self.origin+(40, 0, 0)), .1);

questi scriptbrushmodel mettili uno sopra l'altro in radiant(stesse cordinate x,y,z)

nella mappa poi questo "belt"comparirà nelle cordinate segnate dal self.origin)l'ultima parte del codice)

spero di esserti stato utile...se hai problemi contattami su xfire
Image

Moustache
CJ Worshipper
CJ Worshipper
Posts: 476
Joined: August 18th, 2008, 9:30 am

Re: scipt belt help

Post by Moustache » December 11th, 2011, 7:23 pm

Why not like this:

Code: Select all

belt()
{
   while(1)
   {
      self moveTo( end_point, time_in_seconds );
      wait time_in_seconds - 0.1;
      self.origin = start_point;
   }
}

megazor
CJ Worshipper
CJ Worshipper
Posts: 414
Joined: July 22nd, 2009, 3:02 am
Location: Russia, Vladivostok

Re: scipt belt help

Post by megazor » December 12th, 2011, 1:53 am

but on mp_codjumper_training, that "belt" doesn't move smoothly, thus doesn't look as beautiful as it could.

User avatar
{JUMPER}Alfio
CJ Wannabe
CJ Wannabe
Posts: 9
Joined: June 28th, 2010, 2:02 pm

Re: scipt belt help

Post by {JUMPER}Alfio » December 12th, 2011, 12:57 pm

I found this script
belt()
{
belt1 = getentarray("belt","targetname");
for(i=0;i<belt1.size;i++)
belt1 thread belt_move();
}

belt_move()
{
org_end = (4866,-257,-36);
org_start = (-168,-257,-36);

while(1)
{
self moveto ((self.origin + (64,0,0)), 0.05);

if(self.origin == org_end)
{
self hide();
self notsolid();
self moveto(org_start, 0.05);
}

self waittill ("movedone");
self show();
self solid();
}
}

I created a piece in radians, set TargetName belt; I see the carpet in the game to move endlessly in one direction, what did I do wrong?

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

Re: scipt belt help

Post by Drofder2004 » December 12th, 2011, 2:17 pm

org_end = (4866,-257,-36);
org_start = (-168,-257,-36);

You need these coordinates to be correct for your map.
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
{JUMPER}Alfio
CJ Wannabe
CJ Wannabe
Posts: 9
Joined: June 28th, 2010, 2:02 pm

Re: scipt belt help

Post by {JUMPER}Alfio » December 12th, 2011, 6:00 pm

belt()
{
belt1 = getentarray("belt","targetname");
for(i=0;i<belt1.size;i++)
belt1 thread belt_move();
}

belt_move()
{
org_end = (512,-464,-14);
org_start = (-672,-464,14);

while(1)
{
self moveto ((self.origin + (64,0,0)), 0.05);

if(self.origin == org_end)
{
self hide();
self notsolid();
self moveto(org_start, 0.05);
}

self waittill ("movedone");
self show();
self solid();
}
}

ok this is my script with the correct coordinates, but the tape continues to move indefinitely without returning to the starting point What's wrong?

User avatar
{JUMPER}Alfio
CJ Wannabe
CJ Wannabe
Posts: 9
Joined: June 28th, 2010, 2:02 pm

Re: scipt belt help

Post by {JUMPER}Alfio » December 12th, 2011, 7:08 pm

an scipt_origin or bush with orig texture (orange)
can explain to me what I need to create on radiant, thanks

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests