User Tag List

Results 1 to 8 of 8

Thread: Vacuum

  1. #1
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    32
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,304
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.76%

    Vacuum

    I'm posting this, partly because then I can't ever loose it, and partly because some other people may also find it useful, although probably not in it's current form.

    I needed a 'suction' script, so after quite a bit of trawling through topics, I found one by Linkus, but it didn't really work properly, so I've re-written it to function nicely.
    So Linkus helped, and I also used a bit of code that jman posted from the source code as a guide too.

    Anyway;

    Code:
    ffc script vacuum{
    	void run(){
    		int angle; int xdifference; int ydifference;
    		while(true){
    			xdifference = this->X-Link->X;
    			ydifference = this->Y-Link->Y;
    			angle = ArcTan(ydifference,xdifference);
    			if(angle<0) angle += 2*PI;
    
    			if(angle==PI) this->X++;
    			else if(angle==PI/2) this->Y--;
    			else if(angle==PI*3/2) this->Y++;
    			else if(angle==0 || angle==2*PI) this->X--;
    			else if(angle<PI/2){this->X--;this->Y--;}
    			else if(angle<PI){this->X--;this->Y++;}
    			else if(angle<PI*3/2){this->X++;this->Y++;}
    			else{this->X++;this->Y--;}
    		Waitframes(3);
    		}
    	}
    }
    Sucks the ffc with the script attached over to Link.
    Not really all that useful, but quite fun to watch for a bit, and I'm sure if anyone else needed a suction script, it'd be good for reference.

  2. #2
    Wizrobe The_Amaster's Avatar
    Join Date
    Dec 2005
    Location
    St. Mystere
    Age
    32
    Posts
    3,803
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    8,810
    Level
    28
    vBActivity - Bars
    Lv. Percent
    26.1%

    Re: Vacuum

    so...it's more like a magnetic script? The combos gravitate towards Link?

  3. #3
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    32
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,304
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.76%

    Re: Vacuum

    Well yes, the freeform combo that the script is attached to moves over to Link.

  4. #4
    Wizrobe C-Dawg's Avatar
    Join Date
    Jan 2002
    Posts
    4,205
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    6,612
    Level
    24
    vBActivity - Bars
    Lv. Percent
    99.92%

    Re: Vacuum

    This achieves a more constant velocity than the standard "if left of link, move left, if below link, move up" version of this script, I take it?

  5. #5
    Gel
    Join Date
    Apr 2008
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    619
    Level
    8
    vBActivity - Bars
    Lv. Percent
    84.56%

    Re: Vacuum

    Well it just seemed easier for me.
    I plan to just use a quarter of it later, cause I'm creating a suck script for Kirby.

    It pulls the object in diagonally, then in a horizontal or vertical line.
    I don't know if it acheives a more constant velocity, but it will always converge to a point, whereas the if(left) Vx = 1; method you have to stop when it gets there.

    EDIT: Oops, I'm still on this account.
    Didn't mean to be >_<

    ~Joe123

  6. #6
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,826
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,959
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.22%

    Re: Vacuum

    Neat-o. The script I wrote a while ago doesn't quite suck as much as this one, since your version sucks equally as well in 360 degrees.

    I think I'll turn this into a void() function so I can have the option of whether to make it suck or blow, or suck and blow at the same time...or better yet, be able to specify any on-screen object to get sucked or blowed.

    ...Seriously though. :p

    (fantastic)
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  7. #7
    Wizrobe The_Amaster's Avatar
    Join Date
    Dec 2005
    Location
    St. Mystere
    Age
    32
    Posts
    3,803
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    8,810
    Level
    28
    vBActivity - Bars
    Lv. Percent
    26.1%

    Re: Vacuum

    I plan to just use a quarter of it later, cause I'm creating a suck script for Kirby.
    I am...intrigued

  8. #8
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    32
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,304
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.76%

    Re: Vacuum

    Ah, you haven't heard about it over here yet.
    Hrm.

    Well, at Pure, we're (well, four of us are) working on a Kirby's Adventure tileset.
    AgentLym and Blaman are ripping the graphcis (it's AL's set really, it was his idea originally), Zemious is spriting some subscreen graphics and things, and I'm re-creating the game via scripting in ZC.
    So far, I have Jump, Fly and Slide tackle sorted out, and I'm working on Suck at the moment.


    And I'm glad you're finding it useful Gleeok, I didn't think it was that likely that anyone else did, but I posted it anyway just in case.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social