Would it be possible to script pulling a pushblock with the L button?
And if so, how?
Would it be possible to script pulling a pushblock with the L button?
And if so, how?
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.
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
Hmm, interesting.
I'll have a look into this later, thanks.
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:
Which makes Link move left one pixel every frame for 16 frames, whilst keeping up the DrawTile function and all that nonsense.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(); }
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.
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.
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.
A boolean would be easier than a counter.
Every time through the loop it will flip the movelink variable. When its true, Link moves, when its false, he doesn't.Code:boolean moveLink = true; for i = 0 to 15 if movelink //move link movelink = !movelink end for
Current Quests in Progress...
Zelda: Eya's Song
Urrrr
I don't really understand booleans
Are they like integers, but only with two states, true and false?
Exactly.
Current Quests in Progress...
Zelda: Eya's Song
There are currently 1 users browsing this thread. (0 members and 1 guests)