Read-only archive of the Armageddon Games Forums Archive (2000–2026) · About this archive

Item Scripts- Activating

13 replies · 3,682 views · Started 13 January 2007

How do Item Scripts work? Do the scripts activate the moment you pick them up, or is there a variable to allow them to work only when the button it's equipped to is pressed? I want to make more usable items, but I can't if the scripts activate as long as you have them (Like with the equipment items).

And why is it that my other question has been virtually ignored? 😞

Item scripts activate when you press the B (or A) button. The script occurs for one frame then is destroyed. The engine already allows for scripts to be run when you collect an item, but it isn't selectable in the current beta.

Thanks. I was hoping it'd work like that, but I wanted to make sure first. On a somewhat-related note, is it possible to simply create a certain combo on the screen at a location dependent on the direction Link is facing WITHOUT it being an FFC (it's STILL impossible to make FFCs truly solid, right?)?

I'm assuming we can still include "while" loops in item scripts though, for lasting effects?

Whoops. There's one more important question I need answered:

When I compile a Zscript, how do I tell the compiler that the script in the buffer is an Item Script? Or do Items simply use the FFC scripts?

use

item script script_name

replacing ffc with item. Then, when compiled, put the script under the Item tab.

Yep, just what I assumed. XD I looked at Saffith's ChaserTrap script to see how he set up his lines and stuff, and I noticed he put "ffc script ChaserTrap" before void run(). I figured changing "ffc" to "item" would work. Thanks again!

jman2050 wrote:once you hit a waitframe or the script quits, the script will not run again.

Wha... well wait a minute. How do we code for persistent item effects, then? Like, say I want the item to create a ball of energy that orbits the player and damages enemies. One button press creates it, and it persists until magic is empty or until the button is pressed again.

put the effect in a global script, have the item script trigger it, then have the same item script untrigger it.

Yeah, that's just retarded that we can't let it persist for more than one frame. Think about it... Playable ocarina becomes impossible, even custom projectile shooters and custom "slash" items are now impossible.

EDIT: That method works, but maybe you'd want a simpler way to do it to prevent lag to a degree.

beefster09 wrote:Yeah, that's just retarded that we can't let it persist for more than one frame

I'm inclined to say something crass to you for sassing off to the developers, especially one who I know is working his ass off to advance ZQuest. However, I'll restrain myself and just suggest that you stick to constructive and intelligent suggests rather than telling a Dev that what he's doing is "retarded."

Jman - Global script it is.

Sorry, I didn't see his post first, thus why I edited it. I thought vBulletin had scratch-out tags like with Invision, so I meant to scratch it out.

Here is how you do it:

[strike]Yeah, that's just retarded that we can't let it persist for more than one frame. Think about it... Playable ocarina becomes impossible, even custom projectile shooters and custom "slash" items are now impossible.[/strike]

EDIT: That method works, but maybe you'd want a simpler way to do it to prevent lag to a degree.

[noparse][strike]Yeah, that's just retarded that we can't let it persist for more than one frame. Think about it... Playable ocarina becomes impossible, even custom projectile shooters and custom "slash" items are now impossible.[/strike][/noparse]
Edit:

EDIT: That method works, but maybe you'd want a simpler way to do it to prevent lag to a degree.

Edit: For more, click here.