View Full Version : Item Scripts- Activating
Nimono
01-13-2007, 04:23 PM
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? :(
jman2050
01-13-2007, 04:35 PM
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.
Nimono
01-13-2007, 04:43 PM
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?)?
C-Dawg
01-13-2007, 05:00 PM
I'm assuming we can still include "while" loops in item scripts though, for lasting effects?
jman2050
01-13-2007, 05:05 PM
once you hit a waitframe or the script quits, the script will not run again.
Nimono
01-13-2007, 05:24 PM
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?
jman2050
01-13-2007, 06:35 PM
use
item script script_name
replacing ffc with item. Then, when compiled, put the script under the Item tab.
Nimono
01-13-2007, 07:03 PM
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!
C-Dawg
01-13-2007, 07:26 PM
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.
jman2050
01-13-2007, 08:45 PM
put the effect in a global script, have the item script trigger it, then have the same item script untrigger it.
beefster09
01-13-2007, 08:50 PM
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.
C-Dawg
01-13-2007, 09:14 PM
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.
beefster09
01-13-2007, 09:27 PM
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.
Mega Link
01-13-2007, 10:13 PM
Here is how you do 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.
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:
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 (http://www.armageddongames.net/misc.php?do=bbcodev).
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.