Page 1 of 1

scipt belt help

Posted: December 11th, 2011, 1:35 pm
by {JUMPER}Alfio
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?

Re: scipt belt help

Posted: December 11th, 2011, 3:03 pm
by Goro92
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

Re: scipt belt help

Posted: December 11th, 2011, 7:23 pm
by Moustache
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;
   }
}

Re: scipt belt help

Posted: December 12th, 2011, 1:53 am
by megazor
but on mp_codjumper_training, that "belt" doesn't move smoothly, thus doesn't look as beautiful as it could.

Re: scipt belt help

Posted: December 12th, 2011, 12:57 pm
by {JUMPER}Alfio
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?

Re: scipt belt help

Posted: December 12th, 2011, 2:17 pm
by Drofder2004
org_end = (4866,-257,-36);
org_start = (-168,-257,-36);

You need these coordinates to be correct for your map.

Re: scipt belt help

Posted: December 12th, 2011, 6:00 pm
by {JUMPER}Alfio
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?

Re: scipt belt help

Posted: December 12th, 2011, 7:08 pm
by {JUMPER}Alfio
an scipt_origin or bush with orig texture (orange)
can explain to me what I need to create on radiant, thanks