Jump to content

Photo

um... Noobie need help!!


  • Please log in to reply
167 replies to this topic

#16 Master Maniac

Master Maniac

    Earth, Wind, Fire, and Water.

  • Members
  • Real Name:kris

Posted 27 April 2008 - 11:17 AM

hey joe, to stop movement, couldnt you say something like

CODE
if((link->y-this->y)<18){
link->input_UP=false;


or something to that effect? this probably wouldnt be correct, but you get what im saying. and i said less than 18 because i thought it should keep link a little farther from the guard than just one tile.

#17 AgentLym

AgentLym

    • Zelda and Pokémon Master •

  • Members
  • Location:Skyloft

Posted 27 April 2008 - 12:39 PM

Hm... That's a good idea. I'll try that right now.

====EDIT====

Well, it didn't work, but thanks for trying Master Maniac! I'm going to try a few things, but I'm not feeling very Algebra-y right now... If someone could help, I would greatly appreciate it!! icon_biggrin.gif

While I'm trying, if anyone else has anything to say, go on ahead and say it! icon_biggrin.gif

Thanks!

Edited by AgentLym, 27 April 2008 - 12:51 PM.


#18 Joe123

Joe123

    Retired

  • Members

Posted 27 April 2008 - 03:03 PM

QUOTE(Master Maniac @ Apr 27 2008, 05:17 PM) View Post

hey joe, to stop movement, couldnt you say something like

CODE
if((link->y-this->y)<18){
link->input_UP=false;


or something to that effect? this probably wouldnt be correct, but you get what im saying. and i said less than 18 because i thought it should keep link a little farther from the guard than just one tile.


Did you actually read the script icon_confused2.gif

That's what I did (except with the correct syntax =P)




I haven't actually used the code yet, so I can't tell you why it doesn't work.
I will have a look over the next couple of days, and see what I can do.

Why do you need to feel algebra-y to do it though?
There's no algebra involved really...

I mean, I've used a number and called it 'i', but all it does is increase by one each time the loop goes round, and add that on to where the script checks for coordinate positions.
Not really what I'd call algebra.

#19 AgentLym

AgentLym

    • Zelda and Pokémon Master •

  • Members
  • Location:Skyloft

Posted 27 April 2008 - 03:37 PM

Well, what I meant by Algebra-y is... my brain is slow today. I know what you were trying to do, but yours seems to be a bit too complicated... (not that it is really complicated, though icon_razz.gif )

Here is my revised code:
CODE
import "std.zh"

ffc script guard{
    void run(int left, int right){
    int i;
        while(true){
            if(Link->X <= this->X+16 && Link->X > this->X){
                    if(Link->Y < this->Y+8 && Link->Y >= this->Y) Link->InputLeft = false;
                }
            else if(Link->X >= this->X-16 && Link->X < this->X){
                    if(Link->Y < this->Y+8 && Link->Y >= this->Y) Link->InputRight = false;
                }
            else if(Link->Y >= this->Y-16 && Link->Y < this->Y){
                    if(Link->X < this->X+8 && Link->X >= this->X) Link->InputDown = false;
                }
            else if(Link->Y <= this->Y+16 && Link->Y > this->Y){
                    if(Link->X < this->X+8 && Link->X >= this->X) Link->InputUp = false;
                }
            if(Link->X >= left && Link->X <= right &&  !Link->Item[I_SWORD2]) this->X = Link->X;
        Waitframe();
        }
    }
}


I didn't use those "for(...i...)" lines, and my code fixed a couple bugs... but you can still walk psuedo-diagonnally through the guard. I was just saying that I felt lazy when I said Algebra-y. Plus, equations remind me of algebra. icon_razz.gif

#20 Master Maniac

Master Maniac

    Earth, Wind, Fire, and Water.

  • Members
  • Real Name:kris

Posted 27 April 2008 - 04:00 PM

ahh... oops actually i did look at it but not so hard as to notice the Link->InputUp=false parts.

maybe if you made link stop before you told it that input up will not work? as in

CODE
Link->Dir_Up=false; link->InputUp=false


except i dont think its Dir_up. isnt there a variable for if hes moving in a direction?...

like llink->movement? i would think the reason inputUp doesent work is because it is probably being held when the player approaches the guard. so by my thinking, if you stopped link's movement then told him that he couldnt move up unless he was away from the guard, then he could move up all he wanted to.

#21 Joe123

Joe123

    Retired

  • Members

Posted 27 April 2008 - 04:34 PM

QUOTE(AgentLym @ Apr 27 2008, 09:37 PM) View Post

Well, what I meant by Algebra-y is... my brain is slow today. I know what you were trying to do, but yours seems to be a bit too complicated... (not that it is really complicated, though icon_razz.gif )

Here is my revised code:
CODE
import "std.zh"

ffc script guard{
    void run(int left, int right){
    int i;
        while(true){
            if(Link->X <= this->X+16 && Link->X > this->X){
                    if(Link->Y < this->Y+8 && Link->Y >= this->Y) Link->InputLeft = false;
                }
            else if(Link->X >= this->X-16 && Link->X < this->X){
                    if(Link->Y < this->Y+8 && Link->Y >= this->Y) Link->InputRight = false;
                }
            else if(Link->Y >= this->Y-16 && Link->Y < this->Y){
                    if(Link->X < this->X+8 && Link->X >= this->X) Link->InputDown = false;
                }
            else if(Link->Y <= this->Y+16 && Link->Y > this->Y){
                    if(Link->X < this->X+8 && Link->X >= this->X) Link->InputUp = false;
                }
            if(Link->X >= left && Link->X <= right &&  !Link->Item[I_SWORD2]) this->X = Link->X;
        Waitframe();
        }
    }
}


I didn't use those "for(...i...)" lines, and my code fixed a couple bugs... but you can still walk psuedo-diagonnally through the guard. I was just saying that I felt lazy when I said Algebra-y. Plus, equations remind me of algebra. icon_razz.gif


Hrm.
Don't know why I didn't just do it like that actually, I mean, it's pretty much exactly the same thing and yours is simpler.
I'm not sure about that diagonal thing, I'll give it a check in a bit.


Equations should remind you of algebra, but there are no equations in that script.
Well, not really.




Fraid I have no idea what you're on about MM.
I think you're telling me I should do what I've done, just inventing some new features so that I do it wrong =P

'Link->InputUp = false' means 'Link can't walk up'.

QUOTE
if you stopped link's movement then told him that he couldnt move up unless he was away from the guard, then he could move up all he wanted to.

This is what my code does.

#22 Master Maniac

Master Maniac

    Earth, Wind, Fire, and Water.

  • Members
  • Real Name:kris

Posted 27 April 2008 - 04:56 PM

ahh... sorry joe, im having an off day. <i almost spelled your SN wrong there lol thats how off i am

what if you made it change link's Y position when he got so close to the guard?

CODE
if((link->Y-this->Y)<16){
Link->Y= this->Y+16;


this would move link and give the effect of being un-walkable. again, im pretty sure my syntax is wrong, but yeah. you get what i mean.

...i wonder if i fixed this up if it would actually work...?

*goes off with an idea for part of a script*

EDIT: and i said Y position, because the way i saw it in my head, the guard was blocking passage upward. so i thought to move link down.

Edited by Master Maniac, 27 April 2008 - 04:59 PM.


#23 AgentLym

AgentLym

    • Zelda and Pokémon Master •

  • Members
  • Location:Skyloft

Posted 27 April 2008 - 05:06 PM

That might work. And keep in mind to move Link 8 pixels down, not 16. 'Cause his head overlaps combos by 8 pixels before he can't walk through them. But remember to move him up, left, and right 16 pixels. icon_razz.gif

#24 Joe123

Joe123

    Retired

  • Members

Posted 27 April 2008 - 05:16 PM

That bit of code's fine, apart from the fact that you need 'Abs'.
That script will work if Link is below the knight, but if he's above it, he'll never be able to walk (due to minus numbers).

It's not really a very good way of doing it though, it's much more likely to be buggy than just shutting off the key inputs.



Fair enough though, must be a really off day if you can't spell Joe ^_^ =P

#25 Master Maniac

Master Maniac

    Earth, Wind, Fire, and Water.

  • Members
  • Real Name:kris

Posted 27 April 2008 - 05:25 PM

yeah really messed up day... havent really had to think very much at all until now.

And i could edit that to make it quite a bit less buggy if you would like. i could do the full version quite quickly. (still need to work on ennonfennom's script... but i need some more info for all that)

if i did the full version using this though, it would look like link was shaking by a pixel's width when walking towards the guard. but that should be as buggy as it gets.

#26 Joe123

Joe123

    Retired

  • Members

Posted 27 April 2008 - 05:30 PM

QUOTE
And i could edit that to make it quite a bit less buggy if you would like

Not very easily, I meant in the way it'd interact with other scripts and built in features and things, I think it'd be very hard to get it to be completely free of bugs.
Things which involve manipulating Link's coordinates directly to move him around are very hard to keep completely un-bugged.

QUOTE
if i did the full version using this though, it would look like link was shaking by a pixel's width when walking towards the guard. but that should be as buggy as it gets.


Yeah, that's exactly why it's best to do it via disabling the key inputs ¬_¬

#27 Master Maniac

Master Maniac

    Earth, Wind, Fire, and Water.

  • Members
  • Real Name:kris

Posted 27 April 2008 - 05:39 PM

actually i could make it move him and then disabe the inputs. fair enough?

also, joe, could you tell me how to place a combo underneath link? like a stairs>next or a sensitive warp combo or something. i dont know what the command is for that.

#28 Joe123

Joe123

    Retired

  • Members

Posted 27 April 2008 - 05:44 PM

Why do you need to move him?
If you disable the inputs, he stops walking.

QUOTE(Joe123 @ AGN)
You have to put a Trigger (Sens. Perm) combo underneath Link's feet.

CODE
this->Data = whateverthatcomboIDnumberis;
this->X = Link->X; this->Y = Link->Y;
Waitframes(3);
this->Data = 0;

//or

int combo = Screen->ComboT[ComboAt(Link->X,Link->Y)];
Screen->ComboT[ComboAt(Link->X,Link->Y)] = thatcomboIDnumber;
Waitframes(3);
Screen->ComboT[ComboAt(Link->X,Link->Y)] = combo;

Not the first time I've told you icon_wink.gif

Edited by Joe123, 27 April 2008 - 05:44 PM.


#29 Master Maniac

Master Maniac

    Earth, Wind, Fire, and Water.

  • Members
  • Real Name:kris

Posted 27 April 2008 - 05:48 PM

oops... yeah i remember you saying something about it before, now.

sorry i forgot all about it. anyway, il try to clean my idea up and make it work.

#30 AgentLym

AgentLym

    • Zelda and Pokémon Master •

  • Members
  • Location:Skyloft

Posted 27 April 2008 - 05:49 PM

QUOTE
That bit of code's fine, apart from the fact that you need 'Abs'.


What's "abs"?

And also, I will probably just make a separate code for an up facing guard (where Link can't walk down past a certain point), a left facing guard (where Link can't walk right past a certain point), etc. Then I'll just make one more code for just a FFC that doesn't move, but can't be walked past.

The only problem with that is: Even if you walk to where a down facing guard was NOT, you still couldn't walk up. So you couldn't walk past the guard, but you couldn't go up somewhere beside him, either.

But that problem can be fixed with a little screen design. icon_razz.gif

Edited by AgentLym, 27 April 2008 - 06:09 PM.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users