Jump to content

Photo

Deflecting arrows


  • Please log in to reply
9 replies to this topic

#1 Frocks7Snee

Frocks7Snee

    Illustrious

  • Members

Posted 09 December 2012 - 10:27 AM

I'm in need of a script that can make it so if an enemy shoots an arrow, link can hit it with his sword and it will go in the other direction. Like Ganondorf from OoT, basicly. When link knocks the arrow back, it can damage the enemy. Also, if link is hit, the arrow can hurt him. And the script can just apply to all enemies, or you can set it it in the enemy editor. I don't really care which, but whatever's easier is fine.

That's all! ~c00ln3rd

#2 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 09 December 2012 - 01:43 PM

So you want it to apply to all arrows in the entire game?

Put this one function call in your while(true) loop and all the functions at the bottom of your script file.

Deflect arrows script


#3 Frocks7Snee

Frocks7Snee

    Illustrious

  • Members

Posted 09 December 2012 - 01:52 PM

I added it to my party members + bombchu script, and it compiled! Woot! icon_biggrin.gif


Crap... Didn't work. :/

I put the deflectarrows(); above the first waitframe in the script, and the functions at the bottom. It compiles, but it doesn't work.

I'm starting to understand zscript a little more. FFCs have to do with combos on a screen, globals have to do with gameplay functions (I think) and item scripts have to do with the items. (No duh, Sherlock.)

EDIT: I got the script to work! icon_biggrin.gif

Edited by c00ln3rd, 28 December 2012 - 12:04 PM.


#4 Frocks7Snee

Frocks7Snee

    Illustrious

  • Members

Posted 28 December 2012 - 12:05 PM

Ohay... It's me again. Could you maybe modify the script to make the arrow tile flip when deflected? Kthxbai. xD

#5 Soga

Soga

    Secretly Alive

  • Members

Posted 28 December 2012 - 02:50 PM

QUOTE(c00ln3rd @ Dec 9 2012, 12:52 PM) View Post
I'm starting to understand zscript a little more. FFCs have to do with combos on a screen, globals have to do with gameplay functions (I think) and item scripts have to do with the items. (No duh, Sherlock.)


There's no limitation between FFC and global scripts. Whatever you do in global can be done in FFC. The difference is that global scripts run anytime, anywhere. FFC scripts only run when the FFC with that script loaded is active on the screen.

Item scripts have one limit, which is that they can only run for one frame. Which is why frequently, item scripts are used to provide some "set up" for other code in a FFC or global script to handle over time. For example, an item script could be used to create a LWEAPON (means Link Weapon; these include swords, boomerangs, arrows, bombs, basically anything Link can use as a weapon), but then you would need a global or FFC script to do fancy stuff with that LWEAPON, like changing its position every frame in a particular way that makes it look like it's moving around in a cool way or whatever.

That's how you're supposed to understand ZScript. icon_smile.gif

#6 strike

strike

    life is fragile, temporary, and precious

  • Members
  • Real Name:Olórin

Posted 28 December 2012 - 03:27 PM

This is a long shot. If you want to do this without scripts you could perhaps make links sword a boomerang with a range of a normal sword that reflects arrows. Just spewing out ideas I guess icon_razz.gif . Came up with the idea but never tried it myself. You would have to check the box under boomerang animation for directional sprites (and other things).

-Strike

#7 Frocks7Snee

Frocks7Snee

    Illustrious

  • Members

Posted 28 December 2012 - 03:29 PM

QUOTE(strike @ Dec 28 2012, 03:27 PM) View Post

This is a long shot. If you want to do this without scripts you could perhaps make links sword a boomerang with a range of a normal sword that reflects arrows. Just spewing out ideas I guess icon_razz.gif . Came up with the idea but never tried it myself. You would have to check the box under boomerang animation for directional sprites (and other things).

-Strike

MM here already made a script for me, but thanks anyway. I just need the script to reverse the arrow tile. icon_razz.gif

#8 strike

strike

    life is fragile, temporary, and precious

  • Members
  • Real Name:Olórin

Posted 28 December 2012 - 03:31 PM

That's what you get for only skimming the posts before you! icon_lol.gif

-Strike

#9 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 28 December 2012 - 06:25 PM

This ought to work.

Updated with flips


#10 Frocks7Snee

Frocks7Snee

    Illustrious

  • Members

Posted 28 December 2012 - 06:43 PM

I added the functions to the bottom, replacing the old ones, and added the consts to the top under the other consts. I got this error when compiling:


PASS 1: PARSING
PASS 2: PREPROCESSING
PASS 3: BUILDING SYMBOL TABLES
tmp, LINE 92: ERROR S10: FUNCTION EXTENDENEMIES IS UNDECLARED.

Script


Help? xD

EDIT: Nevermind, I accidentally deleted the enemy extend function. It compiled when I added it back in. icon_smile.gif

Edited by c00ln3rd, 28 December 2012 - 06:57 PM.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users