User Tag List

Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 22

Thread: Pulling Pushblocks

  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,303
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.73%

    Pulling Pushblocks

    Would it be possible to script pulling a pushblock with the L button?
    And if so, how?

  2. #2
    &&
    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,303
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.73%

    Re: Pulling Pushblocks

    Any help please?
    If someone can tell me how to do it, then I can try and do it myself, but as of the moment I have no idea how it would be done. It could really help tidy up some points in my game, and I'm sure other people would find it just as useful.

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

    Re: Pulling Pushblocks

    Hm.

    Well, I guess you could do it by:

    (1) Checking if player is pulling on a push block;
    (2) If so, make Link invisible with an offset item, moving him to the other side of the block. FFC that looks like Link pulling is left where he was. Player is then pushing. Make sure solid push blocks rule is on!
    (3) Put Link back on the other side of the block.

    That would generally work, but it has limitations. Like, if there is a solid block on one side of the block being pushed, can Link push it?

    -C

  4. #4
    &&
    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,303
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.73%

    Re: Pulling Pushblocks

    Hmm, interesting.
    I'll have a look into this later, thanks.

  5. #5
    &&
    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,303
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.73%

    Re: Pulling Pushblocks

    OK, I'm working on this now and it's going quite well.
    I have the Pulling Left direction mostly set up, I just need to sort out interaction with combo types on the far side of the block (which isn't going too well but I'm slowly making progress with), make sure it meshes properly with block triggers, make sure he can't pull whilst on the edge of the screen (which would result in him dissapearing) and sort out it's interaction with the roll script which at the moment is abysmal.

    One problem I'm having, however, is moving Link whilst the block moves (so that it doesn't land on top of my DrawTile Link).
    I have this:
    Code:
    	for(timer = 0; timer < 16; timer++){
    	Link->X = Link->X-1;
    	Link->InputLeft = false;
    	Link->InputRight = false;
    	Link->InputDown = false;
    	Link->InputUp = false;	
    	Screen->DrawTile(2, Link->X-32, Link->Y, 54805, 1, 1, 6, 1, 0, 0, 0, 0, true, 128);
    	Waitframe();
    	}
    Which makes Link move left one pixel every frame for 16 frames, whilst keeping up the DrawTile function and all that nonsense.
    What I need though, is for Link to move left one pixel every other frame. How would I go about doing this? I can't seem to work it out without making 16 for loops, which I am just not doing.

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

    Re: Pulling Pushblocks

    Use a counter. Like this:

    if ( int movement_counter == 1){

    Link->X = Link->X - 1;
    movement_counter = 0;

    }
    else
    {movement_counter++}

    That way, Link will only get moved every other frame. Or increase the "1" if you want him to move every three or whatever.


    OF COURSE you could short-circut this nonsense by setting up an FFC to act as a block. Make the FFC faux unwalkable, have it pullable and pushable. You'd need to script your own switches and so forth though. The way you're doing it lets the player use garden variety push blocks.

  7. #7
    &&
    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,303
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.73%

    Re: Pulling Pushblocks

    You mean put that counter inside the for loop?

    And I know I could do it via an FFC, but I'm all for minimal set-up and minimal use of screen resources.

    Thanks :)

    It's working pretty much perfect now, I just need to duplicate for all directoins.

  8. #8
    Gibdo Praethus's Avatar
    Join Date
    Apr 2002
    Age
    40
    Posts
    894
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,892
    Level
    14
    vBActivity - Bars
    Lv. Percent
    49.16%

    Re: Pulling Pushblocks

    A boolean would be easier than a counter.

    Code:
    boolean moveLink = true;
    
    for i = 0 to 15
       if movelink
          //move link
       movelink = !movelink
    end for
    Every time through the loop it will flip the movelink variable. When its true, Link moves, when its false, he doesn't.
    Current Quests in Progress...
    Zelda: Eya's Song

  9. #9
    &&
    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,303
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.73%

    Re: Pulling Pushblocks

    Urrrr
    I don't really understand booleans
    Are they like integers, but only with two states, true and false?

  10. #10
    Gibdo Praethus's Avatar
    Join Date
    Apr 2002
    Age
    40
    Posts
    894
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,892
    Level
    14
    vBActivity - Bars
    Lv. Percent
    49.16%

    Re: Pulling Pushblocks

    Exactly.
    Current Quests in Progress...
    Zelda: Eya's Song

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