Results 1 to 10 of 15

Thread: Escalators cod2 radiant

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Assuming it wont cause a script stack overflow, you get "self" (the original targetname) to thread the move function again and again:

    Code:
    main()
    {
    	maps\mp\_load::main();
    	
    	Patanosta = getent("patanosta","targetname");//the objekt with the targetname “patanosta” has the name “Patanosta”
    	Patanosta thread Patanosta_Move();//the script contains the thread Patanosta_Move
    
    }
    
    Patanosta_Move()//starts the thread Patanosta_Move
    {
    	Targ1 = getent(self.target,"targetname");
    	Targ2 = getent(Targ1.target,"targetname");
    	Targ3 = getent(Targ2.target,"targetname");
    	Targ4 = getent(Targ3.target,"targetname");
    	Targ5 = getent(Targ4.target,"targetname");
    	Targ6 = getent(Targ5.target,"targetname");
    	Targ7 = getent(Targ6.target,"targetname");
    	Targ8 = getent(Targ7.target,"targetname");
    	Targ9 = getent(Targ8.target,"targetname");
    	Targ10 = getent(Targ9.target,"targetname");
    	Targ11 = getent(Targ10.target,"targetname");
    	Targ12 = getent(Targ11.target,"targetname");
    	Targ13 = getent(Targ12.target,"targetname");
    	Targ13 = getent(Targ12.target,"targetname");
    
    	self moveto (targ1.origin,2);
    		
    	Targ1 moveto (targ2.origin,2);//example explanationŕTarg2 is moving on the psition of targ2 in 20 seconds
    	Targ2 moveto (targ3.origin,2);
    	Targ3 moveto (targ4.origin,2);
    	Targ4 moveto (targ5.origin,2);
    	Targ5 moveto (targ6.origin,2);
    	Targ6 moveto (targ7.origin,2);
    	Targ7 moveto (targ8.origin,2);
    	Targ8 moveto (targ9.origin,2);
    	Targ9 moveto (targ10.origin,2);
    	Targ10 moveto (targ11.origin,2);
    	Targ11 moveto (targ12.origin,2);
    	Targ12 moveto (targ12.origin,2);
    	Targ13 moveto (targ13.origin,2);
    	Targ13 waittill ("movedone");
    	
    	self thread Patanosta_Move();
    }

  2. #2
    ... connecting
    Join Date
    Apr 2015
    Posts
    9
    Thanks
    2
    Thanked 5 Times in 2 Posts
    Quote Originally Posted by Tally View Post
    Assuming it wont cause a script stack overflow, you get "self" (the original targetname) to thread the move function again and again:

    Code:
    main()
    {
    	maps\mp\_load::main();
    	
    	Patanosta = getent("patanosta","targetname");//the objekt with the targetname “patanosta” has the name “Patanosta”
    	Patanosta thread Patanosta_Move();//the script contains the thread Patanosta_Move
    
    }
    
    Patanosta_Move()//starts the thread Patanosta_Move
    {
    	Targ1 = getent(self.target,"targetname");
    	Targ2 = getent(Targ1.target,"targetname");
    	Targ3 = getent(Targ2.target,"targetname");
    	Targ4 = getent(Targ3.target,"targetname");
    	Targ5 = getent(Targ4.target,"targetname");
    	Targ6 = getent(Targ5.target,"targetname");
    	Targ7 = getent(Targ6.target,"targetname");
    	Targ8 = getent(Targ7.target,"targetname");
    	Targ9 = getent(Targ8.target,"targetname");
    	Targ10 = getent(Targ9.target,"targetname");
    	Targ11 = getent(Targ10.target,"targetname");
    	Targ12 = getent(Targ11.target,"targetname");
    	Targ13 = getent(Targ12.target,"targetname");
    	Targ13 = getent(Targ12.target,"targetname");
    
    	self moveto (targ1.origin,2);
    		
    	Targ1 moveto (targ2.origin,2);//example explanationŕTarg2 is moving on the psition of targ2 in 20 seconds
    	Targ2 moveto (targ3.origin,2);
    	Targ3 moveto (targ4.origin,2);
    	Targ4 moveto (targ5.origin,2);
    	Targ5 moveto (targ6.origin,2);
    	Targ6 moveto (targ7.origin,2);
    	Targ7 moveto (targ8.origin,2);
    	Targ8 moveto (targ9.origin,2);
    	Targ9 moveto (targ10.origin,2);
    	Targ10 moveto (targ11.origin,2);
    	Targ11 moveto (targ12.origin,2);
    	Targ12 moveto (targ12.origin,2);
    	Targ13 moveto (targ13.origin,2);
    	Targ13 waittill ("movedone");
    	
    	self thread Patanosta_Move();
    }
    i tried the script you posted but it does exactly the same as it did before

  3. #3
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Quote Originally Posted by p0wner52 View Post
    i tried the script you posted but it does exactly the same as it did before
    What if you put all your targets in an array and save each target's current position. Then you move the target to the next position useing the array's index.

    Something like this
    PHP Code:
    steps = [];
    maxsteps 14;
    time 2;
    steps[steps.size] = getent(self.target,"targetname");
    steps[steps.size-1].position 0;
    for(
    i=0;i<maxsteps-1;i++)
    {
        
    steps[steps.size] = getent(steps[i].target,"targetname");
        
    steps[steps.size-1].position i+1;
    }

    while(
    1)
    {
        for(
    i=0;i<steps.size;i++)
        {
            
    nextposition steps[i].position-1;
            if(
    nextposition 0// no next step, back to top
                
    nextposition steps.size-1;

            
    steps[i].position nextposition;
            
    steps[imoveto(steps[nextposition].origintime);
        }

        
    steps[maxsteps-1waittill("movedone");


  4. #4
    ... connecting
    Join Date
    Apr 2015
    Posts
    9
    Thanks
    2
    Thanked 5 Times in 2 Posts
    Quote Originally Posted by Mitch View Post
    What if you put all your targets in an array and save each target's current position. Then you move the target to the next position useing the array's index.

    Something like this
    PHP Code:
    steps = [];
    maxsteps 14;
    time 2;
    steps[steps.size] = getent(self.target,"targetname");
    steps[steps.size-1].position 0;
    for(
    i=0;i<maxsteps-1;i++)
    {
        
    steps[steps.size] = getent(steps[i].target,"targetname");
        
    steps[steps.size-1].position i+1;
    }

    while(
    1)
    {
        for(
    i=0;i<steps.size;i++)
        {
            
    nextposition steps[i].position-1;
            if(
    nextposition 0// no next step, back to top
                
    nextposition steps.size-1;

            
    steps[i].position nextposition;
            
    steps[imoveto(steps[nextposition].origintime);
        }

        
    steps[maxsteps-1waittill("movedone");

    didnt even know how to make this at all i really dont understand this kind of script but
    ive tried moveto already for like 5hours i thought i made it perfectly but it didnt work out after all

    so does anyone still have ideas xD?


    wish i knew how this guy made his lol
    https://www.youtube.com/watch?v=YKzokeH4IrY

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •