Sign in to follow this  
Followers 0
Tsukihime

Auto Removal

12 posts in this topic

Auto Removal

Tsukihime

 

This script extends the "auto remove timing" for database objects.

The default remove types are

 

1: end of action: when the battler has finished its turn

2: end of turn: when all battlers have finished their turns

 

I define additional remove types

 

3: end of skill: immediately after first skill is used

 

Supports weapons, armors, and states.

 

Download

 

Script: Download here

Demo: Demo

 

Usage

 

To specify a remove type, tag it with

 

<remove_type: x>
Where x is one of the remove type ID's above

 

To specify the remove time, tag it with

 

<remove_time: x y>
Where x and y are integers indicating the min and max removal times Edited by Tsukihime

Share this post


Link to post
Share on other sites

I appreciate this greatly! Thanks for taking the time to do this (for me and whoever else that needs it xD).

 

Hmm, the states aren't being removed. If I have it right, am I supposed to put <remove_type: 3> into my state's note box if I want it to end directly after the next skill*? If so, it's not changing the state. It stays applied. Should I change the auto-removal timing in the database to turn/action end or something?

Edited by Ashern

Share this post


Link to post
Share on other sites

You need to specify the amount of turns to pass before it can be auto-removed.

Just set the duration in turns. editor remove type doesn't matter since I will replace it if you specify a custom one.

 

If you want it removed immediately after you use a skill just set it to 1~1.

Edited by Tsukihime

Share this post


Link to post
Share on other sites

Well I put the

 

<remove_type: 3>

<remove_time: 1 1> (I also tried <remove_time: 1~1>)

 

tags in the state's note box, and it still didn't affect the state. Let me see if I got this correct: I use a skill that applies to state to the caster, and then have it so that the next skill I use will remove the state. So I would put the tags into the same state, right?

Share this post


Link to post
Share on other sites

I'm still having trouble understanding how I'm supposed to set it up :D. See, let me post a picture of how my state looks right now:

 

 

InvokedState.png

 

 

Those <element strengthen> tags are part of the element increase script I'm using. If you could look over that scene and tell me what settings I'd need to change in order to get it working properly... As you must already know, I'm trying to get it to end right after the actor uses a skill. Should I turn the Auto-Removal Timing to Action and set it to 1 ~ 1? Because I tried that and it ended up removing the state before the damage effect was applied, like normally.

Share this post


Link to post
Share on other sites

I don't know what the issue might be then because the <remove_type> should have automatically made it so that it will only be removed after skill use, not before skill use.

Share this post


Link to post
Share on other sites

Well I have the database editor's removal timing set to None, I tried it with Turn/Action as well, but the note tags still didn't affect it. I also tried it in a new project, with it being the only script, and it behaved the same way...hmm

 

Does it work with you? Maybe I could try to copy your set up and see if it's just something I'm doing wrong.

Edited by Ashern

Share this post


Link to post
Share on other sites

This is very, very odd. First off, I'll say -- I tried the demo, and it worked in there. I copied God Mode and the state to my project, used it, and the effect was removed right after the action. I also made a new project and copied the new script (the one in the demo was different from the first script I put in) and made a buff, and it was removed as expected. Now...with the one skill I'm trying to have this removal apply to, it doesn't work. I copied the skill from my project to a new project, and it didn't remove.

 

So, your script works just fine -- it's something with my one skill...I'll try deleting it and remaking it, maybe that'll work. But regardless, thanks for the script -- it does work :D.

 

(EDIT:)

 

Alright, I deleted my original skill and state, and then just remade it. For some reason, it now works. I have literally no idea what the problem was, or how it could be glitched in such a way...

Edited by Ashern

Share this post


Link to post
Share on other sites

Hey Tsuki, I got this error when trying to remove or clearing the equipment

 

autoremoval.jpg

 

 

 

Already tested it in a new blank project and the error still occur, maybe you can fix that. :)

Share this post


Link to post
Share on other sites

This should work. I didn't check whether it was nil (again..)

 

 def set_equip_removal_timing(slot_id, item)
   return unless item
   variance = [item.remove_max_turns - item.remove_min_turns, 0].max    
   @equip_timing[slot_id] = item.remove_min_turns + rand(variance).to_i
 end

 

I will update the script when I have access to it and can test it.

Edited by Tsukihime

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.