I am trying to set up an auto event that will show your health by VFX. The reason why I'm doing that is because I'm using a variable for health and want to see how much health you have in battle. Well, I wanted it to show 4 hearts when your health is full. That part was easy, but when I want to show less hearts when damaged, it will either not change or all of the hearts disapear. I tried multiple things to have them work by using conditions involving the health variable to change the amount of hearts shown when the condition is met. I can't seem to get it right. Any suggestions? This is driving me crazy. Oh, I probably should mention that the combat is an ACBS. It doesn't involve the regular battle system at all. You are just moving around shooting at stuff. Sorry if there is any confusion, I'm bad at explaining things.
Announcement
Collapse
No announcement yet.
Damn! I need some help.
Collapse
X
-
Re: Damn! I need some help.
Yes getting VFX to dissapear in a controled fashion is very hard. One idea is to have a VFX that lasts for one frame and keep refreshing it every 1 frame, (or some other number of frames). So your script would be
Repeat: Flag (off) is OFF
Sort [Health]
Apply if 4
Display [heart 4]
Apply if 3
Display [heart 3]
Apply if 2
Display [heart 2]
Apply if 1
Display [heart 1]
SB: End
Wait 1 frame;
SB: End
Your heart effects would then be 2D effects so you don't have to worry about camera rotates and such.
The other option is to have a VFX refresh script for all VFX on your map. Then you can clear all VFX when they get hit and run a script simlar to the one shown to display the appropriate number of hearts
SB Repeat Flag (off) OFF
SB Condition Flag [VFX Refresh] ON
Call [Display Hearts]
Call [Display World VFX]
SB: End
Wait 5 frames (might be needed to not cause slow down, or it might not you'll just have to test).
SB: End
EDIT: Just to clarify on this one the heart effects would have an infinite length (set length to 0 in the VFX editor), since they will be cleared anyway. and you only call this script when the health changes.
It would have been nice to have a undisplay effect blah command, but there isn't one only one that clears all of them, so these are the two work arounds I know of, refreshing certain ones and making them short, or having a redisplay script for all of your maps, and battle stuff.Last edited by thetruecoolness; 03-04-2006, 07:07 AM.
-
Re: Damn! I need some help.
I suggest making the VFX Reset script.
The drawback to looping single frame effects as above is that, being an action script, it gets held up in between the "Clear All FX" and the "Reboot" so that the effect will be off while anything going on in a content script is running.
Example:
The living sword main character in Videogamedrome swings on a map with VFX.
I need to clear all effects before playing the swing animation or the wait animation will still be there.
Now, lets say that I used the looping action script for a nearby effect.
It would vanish with the clear command, but stay gone for the entire swing and only come back when the script that called the swing animation has finished running.
If swinging at a VFX Enemy this would be disasterous!
It's just like when wanderers stop wandering while you are talking to someone else.
Action scripts have limits that make this great idea fail.
I sometimes have to call this script several times in a single event because I use a lot of VFX Characters and they vanish if not replaced!
Comment
-
Re: Damn! I need some help.
I'm not completely sure on this (it's a method I need to test out when I create my own meters), but you could set the effect to an event with multiple pages. For a basic example, the first page being empty, and the second using the VFX (set to infinate) in an action script when a flag or variable is set right, with other pages set to display various other VFX for health. I think that after the VFX command, you'd have to set the flag/variable back to default so it doesn't constantly show the VFX and crash your game. Unfortunately, I've found that you can't have an event actually switch to another page of its own through flag/variable change. Setting the change in itself will merely stop the event from repeating the script. So, when you want it to really switch to another page, you'll have to use a separate event that changes the required flag/variable using a branch.
The idea's still a work-in-progress with me, though, but I'm sure it could be used for other instances, like placing an effect on the player and having him do a quick animation without halting the game in the process."What if like...there was an exact copy of you somewhere, except they're the opposite gender, like you guys could literally have a freaky friday moment and nothing would change. Imagine the best friendship that could be found there."
Comment



5198-2124-7210 Smash

Comment