Log in

View Full Version : So. How about a throwing script?



Stungun
01-10-2007, 11:38 PM
Think it might be possible to make some kind of a script that would allow stuff to be picked up and thrown (with ZC's R button) if you have an appropriate bracelet? I don't know much about the capabilities of scripting; Would I just be able to plop the script on a screen anywhere and it'd affect all Push-Heavy combo types onscreen, or would I have to place the scripts directly into an FFC combo that would serve as a throwable object?

If this worked I would want it to be fairly flexible with arguments, but I want to know just what of the following we can do, and how I'd go about putting this down.

1. Pick up an object with the R-button (not the R keyboard key). Whatever is picked up should be hoisted above Link's head. While there's one of these pickable objects above his head, you cannot use the A or B button items. Pressing any button (save START, SELECT, or the directions) would immediatly throw the object instead of doing what the button is supposed to do.
2. Possibly allow the A/B buttons to pick up an object IF the Power Bracelet is equipped as a usable object (Not sure if ZC'd handle that well, though).
REASON: Greater possibility for LA-style quests.
3. When an object is thrown, it casts a shadow and immediatly is launched forwards. The distance/speed of the throw is dependant on an argument. Please provide a default, ideal value.
REASON: We don't want 5 ton statues sailing at the speed of light, do we? Or little bushes only flying forwards a few feet. This opens up possibility for realism.
4. If the object collides with an enemy, the enemy takes damage (dependant on an argument). The object is destroyed upon colliding with an enemy UNLESS you can tell whether or not the enemy will die from the hit; In that case the object is only destroyed if the enemy's still alive from that hit.
REASON: 5 pound stones weigh, and hurt when tossed at you, a lot more than 5 ounce bushes.
5a. If we can make it affect certain combos onscreen instead of the FFC itself having to be the thrown combo, an argument will determine what combos are throwable on that screen; Bushes and the entire family of Push combos are viable options. Naturally PushHeavy and PushHeavy2 combos NEED varying levels of the bracelet to work.
5b. If we can't make the FFC affect the various combos onscreen, than an argument determines what level of bracelet you need to throw it (0=no bracelet, 1=worn-out glove, 2=normal bracelet, 3=level 2 bracelet... anything else is taken as an item ID needed to lift the combo).
6. When the object hits the ground, it is destroyed:
6a. If the script affects combos, bushes leave behind Bush Clippings and every other combo type leaves behind flower clippings or whatever they're called. Bushes will also leave behind items at the impact point, and an argument determines whether or not other types will leave behind items.
6b. If the FFC itself has to be used as the liftable item... an argument determines how the game behaves when the object breaks (0=nothing, 1=bush leaves, 2=flower clippings, 3=nothing w/item left behind, 4=bush leaves w/item, 5=flower clippings w/item)
REASON: Link's Awakening-style gameplay. I'd just replace flower clipping graphics with little chunks of rock, so you know. And items being left behind are a must.
7. If the player leaves the screen, the object overhead is destroyed, nothing is left behind. No items, no clippings.
REASON: Bug reduction. I'm sure you'd have tons of trouble getting the throwable item to leave the screen anyway.
8. SFX ID 150 or something is played when an item is picked up, I know ZC already has a SFX that sounds ideal for throwing.
8a. If the script affects combos, bushes use a preset sound (I think there's already a ZC sound for bushes being slashed) when they hit the ground, but any other type of combo uses an SFX ID dependent on an argument.
8b. If the FFC itself has to be used as the liftable item, an argument determines what the SFX ID will be when the object hits the ground.
REASON: Like Link's Awakening, there are three sounds for every process of lift/throw/crash. The crash sound depends on what the combo was; Bushes rustle, all the rest make an ugly crunch sound.
9. It has to be compatible with liftable combos on other layers, if possible.
REASON: User-friendly. And I'm sure due to transparency issues people would want liftable combos on other layers.
10. The combo left behind after the object is thrown depends on an argument. 0 means use the screen's undercombo (if possible), 1-16 means use secret tiles 1-16 (if possible), and the rest indicate a combo ID to leave behind.
REASON: What else are you going to do? Have a fountain of unlimited stones?

I don't think I missed anything... I just want to see if ZC is really capable of doing LttP/LA-style lifting and throwing with scripting. Of course, if a good script comes out of this, I will most likely use it for quests I make. I don't have the slightest idea how Link's tiles are going to be handled through this (and frankly, I almost don't care).

I just hope we have enough arguments to use for this. I know this is kind of a demanding proposition... but all the more challenging, eh?

At least let me know whether this is possible, and whether we could just make the script affect all combos of certain types on the screen... or whether we'd need to put down an FFC for every throwable item onscreen.

Thank you.

C-Dawg
01-11-2007, 11:49 AM
Yea, you could do this.

1. When Link is facing and close to a pick-upable FFC (which simulated unwalkability), and presses R, AND has the necessary bracelet:
2. Hide Link under an unwalkable combo and move an otherwise invisible FFC to Link's previous location drawn to look just like Link.
3. Link's input moves the faux-Link instead of real Link, A and B do nothing.
4. Pressing R tosses the pot FFC and returns Link to the position of the moving FFC.

The tricky bit would be detecting hits on the faux FFC. Perhaps, as soon as the faux FFC is close to an enemy, it automatically executes the throw and returns Link? Then, it would also be tricky to simulate enemies being damaged by the pot. You'd have to manually move them back, reduce their HP, and flash their CSET.