I'm trying to create a skill that uses an item to create another item. This would be simple if the skill would allow me to use a control switch, instead of a common event, this is what makes this a little complicated for me.
Its basically a skill called "Blood Syphon.(S) " (For small since there will be 4 types,)
When used its supposed to require 1 Empty Vial, which is deducted by 1 upon using and generates 1 Small Blood Vial., I don't mind if the ability is still usable without the Empty Vial as it will deduct some tech points and deal slightly higher than normal damage, it just wont generate a small blood vial without it,setting that as a condition wasn't hard to do, its just activating the skill itself through a common event.
Maybe I can edit the game script so that I can choose to turn on and off control switches through the use of skills via the "Other" add param/state feature?
Why can't you do it as a common event? How would you do it with a switch instead of a common event?
Conditional Branch: Item [Empty Vial] Exists
Change Items -1 Empty Vial
Change Items += Small Blood Vial
Branch End
Because if the item is set to 0, then you gain one like through spoils of combat, it runs the event :| without using the skill because it sees "Empty Vial now exists )(Tried this already ) (Or I set it wrong somehow ) It can work as a common event, but the criteria to run the common event is a little more complicated as it wants you to use "AUTO RUN" which is causing the problem, if I set it to none, it just doesn't work no matter what I do.
If I can run it as a switch trigger (I.E the skill just turns it on without need for auto run/PP) I can set it to turn on when using the skill, and turning off after I get the item provided an Empty vial is present. (which if one is not, the skill simply deals damage)
Help me figure this out please 🙂
(edit) using it with your script just made it automatically turn into blood vials instantly as I obtained empty ones 😀 hahaha oh man..
AHA! I think I fixed it. I had to make 2 common events, the skill to call upon the event to turn on the autorun for the common event and common event itself that increases and decreases the items.
I probably could have done it with 1 if I was better with common events, but using these two worked perfectly.
no, one common event is enough. You must have set it up incorrectly. Please post your original common event so we can troubleshoot (or just attach the one that does the logic - change the autorun trigger to none - to the skill, and delete the one that does nothing but turn on a switch).
I don't remember the original.
Blood Syphon S) (AUTO RUN) Condition = 0052: Blood Syphon (S)
@>Conditional Branch: [Empty Vial] in Inventory
@>Change Items: [Empty Vial]. -1
@>Change Items: [Small blood vial], +1
@>Control Switches: [0052:Blood Syphon S)] = OFF
@>
: Else
@>
: Branch end
@>
____________________________________________________________________________
Run CE Blood Syphon (NONE)
@> Control Switches: [0052:Blood Syphon (S)] = ON
This is working perfectly right now. Using the skill causes the Common event to run that turns on the switch.
I tried getting it to do this in one but the common event wont run if the switch isnt already on without it being set to auto run, and in doing so, it causes the game to freeze/loop. (At least how I had it setup)
Here are the problems I kept running into and why I finally decided to just make 2 CE.
1. Game would freeze loop. (probably because it tried to auto run and because there were no empty vials in the inventory its locked up till it can obtain one) {like if you cause a sprite to set move and it hits an un-path able area)
2.Skill would work, but every time an empty vial was obtained it would automatically run the event that caused one to increase and decrease the values of the said items)
3. Having it set to "None" or no trigger would not let the event run when I used the skill. because the switch had to apparently be turned on prior to that CE running, trying to turn it on inside the CE again caused nothing to work.
So get rid of the common event that turns the switch on, and attach the common event that does the grunt work to the skill, and remove the line where the switch is turned off from that one. Also set it to no trigger.
There is no point running an event, an event page, or a common event, that has a single command to turn on a switch, where the switch controls an autorun or parallel process event that does a couple of things and then turns the switch off again - at least in this case.
You just need the common event to do the conditional branch to check if the empty vial is in inventory, and if it is, swap it for the filled vial, which is exactly the solution I gave in my first response.
I thought so too and thats exactly how I at first had it, and it just didnt work, the skill would not activate the common event without the switch being turned on, to actually run it and when it did, it caused the problem of constantly running every time an empty vial was obtained, instead of when I used the skill.
(that might indicate where my stuff was written wrong )
Its like a big catch 22, which is why I just used another common event to turn the switch on so it could auto run without breaking the game, basically why I asked if I can edit the states to cause a switch to turn on, instead of just using a common event.
I'll try and move it around like you're saying and see if it works on my backup file
Common events set to autorun or parallel process don't run in battle, unless you have a script to make them. However, they will run constantly while on the map, as long as the switch is turned on. This would cause you to continually receive the filled vial every time you obtained an empty vial. In fact, if you had it set to autorun and the switch was on, it would also have stopped you walking around in the game - you would have had no control over the player, and you would have been frozen.
In battle, common events will only run if you use a Call Common Event command in a troop tab, or associate the common event with a skill or item. In that case, no switches are used, and the trigger stays as None.
It sounds to me like you had the skill attached to the common event, but for some reason still had it set to autorun or parallel process, with a switch to activate, and that switch was turned on.
The first time I set it up it was exactly like that, and I kept running into the aforementioned problems.
the very first one being, that it would run the event every time an empty vial was obtained, or if I had a surplus of empty vials in my inventory it used one after every turn.
I tried it with and without auto run, auto run broke it with or without a switch being turned on within itself but having it set to turn on from another CE and turn itself off after the item check fixed prob of those 2 major problems for me.
Trying to switch it around now in the backup copy of my game. 😀
Awesome I think its working perf without the two 😀 Thanks for your help and the explanation on how common events work! 10/10
Darn now I just wish I could remember where I did wrong at the start >.< I think I just didn't have the "switch on" in the right place... iirc it was inside the conditional branch instead of infront of it...
I can't remember :| argh.. but maybe thats why it kept looping when one was obtained?
Actually nope, its doing the same thing now where its automatically converting into empty Vials. >.< it does that when I enter battle.
Trigger is set to none
Control Switches: [0052: Blood Syphon (S)] = ON
Conditional Branch: [Empty Vial] in Inventory.
Change items: Empty Vial -1
Change items : small blood vial + 1
Control switches 0052 Blood Syphon (S) = OFF
End
^ This is causing it to convert all empty vials into small blood vials at the start of any given battle, but as you said CE won't run on the map unless a switch is turned on, so when the battle starts, it runs it.
You absolutely do NOT need the Control Switches commands. Please get rid of both of them. They do nothing, and add to your confusion.
Then please give me screenshots of each of the following:
1. The common event
2. The skill that is attached to the common event
3. The Troop page that has the troop you are battling when you are testing this skill. If you have several event pages for the troop, please show each one
Please show the WHOLE window in the screenshot - do not crop it to just a part that you think is important, or you might omit something that IS important.
Unless you have a script that makes common events run during battle, or you are specifically calling the common event during battle, what you say cannot be happening. Common events do NOT run during battle unless you specifically tell them to run, either by a Call Common Event command, or by executing a skill or using an item that is attached to the common event (and neither of those would happen at the start of the battle).
DO you have a script that allows common events set to autorun or parallel process to run during battle? I know Tsukihime wrote one. Just want to make sure you don't have something set up in scripts that is changing the default behaviour.
Or you can just zip up your whole project and load it up so I can grab it and check it out. That might be faster as I won't have to ask you for any more screenshots, checks or tests.
edit: check your troop event pages - it sounds like it's actually working, but maybe you have something else set up for the purposes of testing that you forgot about. But still get rid of those Control Switch commands.
You can't attach a zip file. Just load it up somewhere - dropbox or something - and provide the link to it. I think the only way I'm going to be able to solve it is to actually see your project, because you're insisting that you need the switches and won't run it without them, and I'm insisting that you don't need the switches and that something else is causing it to run at the start of battle. I need to be able to actually see and debug it step by step, and to change things to test them. Being able to have a good look through your scripts will also be helpful.
If you can provide the zipped project along with a save file at the appropriate place where the skill is added and I can use it, that'll let me start testing without having to spend a heap of time playing through to the right point.
Something else you could try beforehand (I looked and can't see that you said you've done this, but I've been helping someone else today and I might be getting what you said mixed up with what they said) is to create a brand new project, NO changes to scripts at all, and JUST add the items, the skill and the common event (exactly as I showed it in my first response in this thread) and see if that works. If it does, it might point to a script as the problem.
Thats a good idea,
No save file would be needed as you get it after the introduction and opening battle scene, so just start a new game (Reason why is because I have certain global things turn on at the end of the cut scene, but those shouldn't affect the skill, its just the clock and day/night phases)
I was pretty sure I was trying to follow your directions on this, and if the switches were doing nothing, then they wern't the problem, just a step that doesn't hurt nor help,
What helped me learn that it was running when I didn't want too was the help of a text box that would say "small blood vial obtained!" which told me it was running despite me telling it to.
This is so far the only work around ive found that makes it work and act as I want it too unfortunately is with the two common events
feel free to look at other things, Im sure there are much more effecient ways to do many of the things I've done in this year long project ( on and off )