I've been thinking and thinking, and I've come up with nothing. I have been setting up this game for a while. I'm making it so you can kill the enemy, (not too hard I realize lol) but you can also trap him first. Where a looped rope on the ground swipes his feet and he goes upside down and he's stuck, just sitting there. Just like in the movies/cartoons and whatnot.
I got everything working. (animated I mean) to where he can swing with all the directions the character could swing in. But I'm stumped as to how to make an actual rope move. Kinda sway, but when the characer comes up to it and pushes it it will sway in the direction he moved it in. Any ideas?
n/a
Assault Andy Administrator
I make other people create vaporware
Registered 29/07/2002
Points 5686
30th June, 2004 at 20:02:05 -
I'm not really sure how you have coded this, but if you are using directions then you could use this piece of code:
Player collides with rope - Set rope direction to player direction. (Using Expression Calculator)
Okay... I haven't actually tried this myself, but I'm assuming it works...
First, set how much X position you want it to move by changing Alterable Value C.
>Start of Frame
->Set Alterable Value C (Rope) to 5
Now, set how much Y position you want it to move with Alterable Value D.
>Start of Frame
->Set Alterable Value D (Rope) to 3
Now that you have those, you need the actual swinging part. To make it go back and forth, you need this...
>Always
->Set X position (Rope) to X(rope) + Alterable Value A (Rope)
Ok, another part of making the rope move...
>Always
>Internal Flag 0 (Rope) is on (I'll explain the flag later)
->Add 1 to Alterable Value A (Rope)
And this part's sister coding...
>Always
>Internal Flag 0 (Rope) is off
->Subtract 1 from Alterable Value A (Rope)
Alright, now we need to make it switch directions.
>Alterable Value A (Rope)= Alterable Value C (Rope)
->Set Internal Flag 0 off
And this part's cousin... (We're getting a family here!)
>Alterable Value A (Rope)= Alterable Value A (Rope) - Alterable Value C (Rope)*2
->Set Internal Flag 0 (Rope) on
Going off of the X position part, you should be able to get the Y position, because they are pretty much the same.
Now, you need two things. An object at the Rope's Connection Point, (Should be wherever you want the rope to come down from) amd the Drawline object. Make the Drawline draw a line between the Connection Point and the Rope Point. I haven't used Drawline for a long time, so I don't know what the code looks like.
Anyway, a good thing about the Alterable Value C and D is that you can make random lengths of rope with it.
>Start of Frame
->Set Alterable Value C (Rope) to 3 + Random (5)
->Set Alterable Value D (Rope) to 2 + Random (3)
If you find out what sort of number is required for Alterable Value D to make the animation look better, just make it so that this happens...
>Timer is equal to 1:00 (1 second)
->Set Alterable Value D (Rope) to Alterable Value C (Rope) / 2
I hope you can understand this. Cya!
Wise sayings:
"A pint of example is worth a gallon of advice."
"Do unto others as you want done unto you."
"An idea is nothing without effort."
"HOLY CRAP!"
hey I got the drawline extension, not a clue what to do with it, or what any of it does... lol know of any good tutorials on it? so I can learn and hopefully use it to get this working. So far I got all that other stuff set up. (doing it in tgf so I changed the D value you had to B I think. Should work just the same.)
I think I understand most of that, other than the drawline portion. so I guess until that's set up... it wont do much good. I do appreciate the help a lot though. Just need to figure out what I'm supposed to do with drawline...
Well, the only bug I know of is the one where it pastes itself into the background... Merely make an active object that has the same color/design as what you want your background to be, and have it paste itself into the background.
Wise sayings:
"A pint of example is worth a gallon of advice."
"Do unto others as you want done unto you."
"An idea is nothing without effort."
"HOLY CRAP!"
I just posted a swinging rope tutorial in the downloads section. That should work fine, except that it uses drawline.
Wise sayings:
"A pint of example is worth a gallon of advice."
"Do unto others as you want done unto you."
"An idea is nothing without effort."
"HOLY CRAP!"
That should work fine, EXCEPT THAT IT USES DRAWLINE.
Wise sayings:
"A pint of example is worth a gallon of advice."
"Do unto others as you want done unto you."
"An idea is nothing without effort."
"HOLY CRAP!"