PDA

View Full Version : Magnetic Gauntlets algorithm



_L_
01-21-2007, 01:19 PM
Magnetic Gauntlets
When this item is being used, the script should do all of the following every turn:

* Play a sound.
* Draw "magnet sparks" in front of Link.
* Set a global variable (representing the item's mode) to either "attract" or "repel".
* For the combo directly in front of Link:
- If the combo is not solid, check the combo in front of that combo. Repeat until the checked combo is solid.
- Check if the combo has a certain ID. (i.e if it is magnetic)
- If so, set Link's Z to 1 (so that he ignores warps and holes) and move him toward (or away from) the combo (such that he won't be pulled into the combo, of course).
* Also, perform the following for every enemy in the room:
- Check if the enemy is magnetic (i.e a Darknut)
- If so, check if it is in front of Link, given Link's position and direction.
- If so, move it toward (or away from) Link.

(The meaning of "in front of" depends on Link's current direction, of course.)

Nimono
01-21-2007, 02:24 PM
_L_, you won't believe this, but.... Someone at PureZC actually asked me to try and make this. The way I see it, it shouldn't be TOO hard to make, right? ....Right? By the way, wouldn't this require that you (or any other dev) allow us to truly edit items and/or put any item on the subscreen in the next beta...?

_L_
01-23-2007, 04:41 AM
The words "the next beta" have no meaning at this point, now that we're releasing builds. But certainly I'd very much like selectable scripted weapons to be in 2.5.

beefster09
01-23-2007, 10:14 AM
It might be possible already... I haven't checked yet. Just give the item a random class number.

Nimono
01-23-2007, 11:31 AM
The words "the next beta" have no meaning at this point, now that we're releasing builds. But certainly I'd very much like selectable scripted weapons to be in 2.5.

Okay, "the next build" then. XD

I'd like to have scripted weapons in the subscreen without resorting to getting rid of an existing weapon, though it'd only work if we had little "flags" to tell what all it does... Like stabbing, slashing, Magic-shooting, that sort of thing. ;)

C-Dawg
01-23-2007, 03:25 PM
Magnetic Gauntlets
When this item is being used, the script should do all of the following every turn:

* Play a sound.
* Draw "magnet sparks" in front of Link.
* Set a global variable (representing the item's mode) to either "attract" or "repel".
* For the combo directly in front of Link:
- If the combo is not solid, check the combo in front of that combo. Repeat until the checked combo is solid.
- Check if the combo has a certain ID. (i.e if it is magnetic)
- If so, set Link's Z to 1 (so that he ignores warps and holes) and move him toward (or away from) the combo (such that he won't be pulled into the combo, of course).
* Also, perform the following for every enemy in the room:
- Check if the enemy is magnetic (i.e a Darknut)
- If so, check if it is in front of Link, given Link's position and direction.
- If so, move it toward (or away from) Link.

(The meaning of "in front of" depends on Link's current direction, of course.)

Yea, this should be totally doable. If I have time, I'll code it sometime this week.

Oh, you'd want to change one thing, though. I imagine you want the gloves to pull link over unwalkable combos that are "below" Link visually, right? Like water, pits that don't warp, etc? So you'd need to check the combo ID or combo type of the solid combo you encounter in step 4 before deciding to stop looking.

And that gives rise to another issue. The gloves need to prevent Link from stopping over an otherwise unwalkable combo like water or an unwalkable pit. So it should only stop moving him if: 1) He's not holding the item activation button and he's on a walkable combo; OR 3) He's next to the magnetic combo.

_L_
01-23-2007, 10:38 PM
Ideally, these gauntlets would be used only to cross my new drownable water (which is progressing fine, thank you.)

Shoelace
01-24-2007, 12:03 AM
Awesome, I was planning on putting this in my game. If this is put in, my scripter no longer would have to script it. So good luck on the scripting! :P

Shoelace
04-15-2007, 06:34 PM
So what is the status on this? I am really really really really really really excited about this script. O_O