PDA

View Full Version : Item-Giving script



Nimono
12-02-2006, 10:15 PM
I can't script to save my life. XD

I'm requesting a script that gives Link certain items when certain requirements are met. Here's my general idea (and it's probably impossible, but what the heck):

-The script checks first for Link's Sword. If Link has a Sword (any level will do), the script checks to see if Link has the Spin Attack Tiger Scroll. If it comes back false (meaning he doesn't have it), it gives it to him and ends the script. (You know where this is going- Swordsmaster who "teaches" Link different attacks depending on how far you are in the quest.) If it comes back true, however (meaning he DOES have it), it goes to the next part.
-The script now checks to see if Link has the White Sword. If he does, it checks to see if Link has 7 hearts. If he does, it checks for the Cross Beams Scroll. If false, give it to Link and end script. If true, skip to next part.
-Now it checks for the Hammer. If true, check for Quake Hammer Scroll. If false, give to Link and end script. If true, well... You know. ;)
-Finally, the script checks for these: Hammer, Wand, Power Bracelet 2, Magic Boomerang, 5 Magic Containers, and 12 Hearts, all in that order. If all return true, it checks for Super Quake Scroll. Again, false=Link gets item and script ends. However, if this is true, it simply ends the script.
-At any point in the script, if a function returns false (except when checking for a scroll), the script is ended. I want it to be you gain the Scrolls in the order of Spin Attack, Cross Beams, Quake Hammer, and Super Quake. The last two are optional unless special combos/flags are made that react to them. Then only the Super Quake will be optional. I find this better than having to search for the scrolls. Plus, it looks cool. :cool:

I'm sure that some/most of this is impossible, but I do want it to basically give you a scroll. If it's impossible to give the player one of the scrolls by checking the items he/she has, then I just need to know how to make a script that creates a specific item on the exact spot where Link is standing. Oh yes, for each time that I said anything along the lines of "gives Link the scroll", I mean that it actually CREATES the item at the exact location where Link is standing. Thanks in advance!

C-Dawg
12-03-2006, 05:05 PM
This isn't impossible at all. And you can script it yourself, happily.

Your script is just an if-then statement. If Link has item1, and Link has item2, etc, THEN give him item3. Really simple. Check out the documentation for pointers to Link's items and such, post some of your code, and we'll fix it up.

Nimono
12-03-2006, 06:02 PM
This isn't impossible at all. And you can script it yourself, happily.

Your script is just an if-then statement. If Link has item1, and Link has item2, etc, THEN give him item3. Really simple. Check out the documentation for pointers to Link's items and such, post some of your code, and we'll fix it up.

One problem- I can't script. I have no idea what commands I can use. I'll look around and see if I can't see what I can find, then see if I can't make a simple test script of something else first, like maybe an FFC that moves up and down, but goes left and right if it's on the same X-row as Link... Meh. I'll get back to you.

ShadowTiger
12-03-2006, 06:09 PM
I used to think that too. Read (http://www.armageddongames.net/showthread.php?t=94699) All (http://www.armageddongames.net/showthread.php?t=94848) These (http://www.armageddongames.net/showthread.php?t=93360) Threads (http://www.armageddongames.net/showthread.php?t=93851) and learn how to script. Far easier said than done, naturally, but I literally couldn't script my way out of a paper bag. Now I'm about to do just that, if I play my cards right. Study these threads and see if you can't figure out the syntax. Remember, read code from right to left; cram values into the variables from right to left, etc.

Nimono
12-03-2006, 06:17 PM
Thanks, ShadowTiger. (Even thought that is for ZScript and I want to use Zasm. XD) Hehehe, I opened up all of them in oindividual windows. How foolish of me. Hehehehe. Okay, I'll see if these can help me. Thanks.