Jump to content


Photo

Scope Change


  • Please log in to reply
32 replies to this topic

#1 Tsukihime

Tsukihime

    Advanced Member

  • Ace Member
  • 7,120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 18 August 2012 - 08:05 PM

Scope Change
-Tsukihime

hGSrP.jpg

This script extends the scope system by allowing you to dynamically change scopes.

You can change a skill's scope from one target to all targets (toggling), or change the scope from enemies to allies (inverting).

This applies to all items and skills.

Usage

By default, all skills and items cannot change scopes.
To enable scope changing, tag them with

<invert scope>
<toggle scope>
The default key settings are:

L (keyboard Q): toggle key
R (keyboard W): invert key

Scope changing can occur during a battle, or in the item/skill scenes.

OwhfR.jpg

Download

Script: Download here
Required: Tsuki Action

Notes

For scripters: this script directly accesses and changes the `scope` attribute in RPG::Skill and RPG::Item. This means that the scopes do not "reset" to their original settings across battles, and if you were to close the game and restart it, the scopes will revert to their original settings UNLESS you are using scripts to save the state of the $data_ variables (which you shouldn't be doing anyways).

Edited by Tsukihime, 16 August 2016 - 09:38 AM.

All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#2 Whale

Whale

    Advanced Member

  • Ace Member
  • 74 posts

Posted 18 August 2012 - 10:30 PM

Once again, wow, thanks for an awesome script.

#3 Tammsyn

Tammsyn

    Advanced Member

  • Ace Member
  • 173 posts

Posted 22 August 2012 - 01:28 PM

ok i cant get this to work im using yami's 8d battle system
http://yamiworld.wor...s/#comment-1558

well ok it does work (forgot the tags) but for some reason when i switch targets from ally to enemy it just gets a null result and when switching from single to all then it only highlights one actor or enemy but still apply the affect to all (just not visual in selection)

Edited by Pheebes, 22 August 2012 - 01:37 PM.


#4 Tsukihime

Tsukihime

    Advanced Member

  • Ace Member
  • 7,120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 22 August 2012 - 01:47 PM

The script depends on the battle system. I only wrote it for the default system.
Different battle systems will need to modify their battle scene to correctly handle scope changing.

Edited by Tsukihime, 22 August 2012 - 01:48 PM.

All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#5 Tammsyn

Tammsyn

    Advanced Member

  • Ace Member
  • 173 posts

Posted 22 August 2012 - 02:00 PM

ah ok thank you

#6 Sidbot

Sidbot

    Advanced Member

  • Ace Member
  • 60 posts

Posted 23 August 2012 - 10:59 AM

This is so useful. It's good to have the classic Final Fantasy scope selection!

#7 Tsukihime

Tsukihime

    Advanced Member

  • Ace Member
  • 7,120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 23 August 2012 - 12:18 PM

Ok it looks like the script is incompatible with yanfly's target manager, though I don't know why.

Edited by Tsukihime, 23 August 2012 - 12:18 PM.

All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#8 Tammsyn

Tammsyn

    Advanced Member

  • Ace Member
  • 173 posts

Posted 23 August 2012 - 01:02 PM

it does work wit the target select (its used in yamis battle system and they both work it seams

#9 WCouillard

WCouillard

    Sanubian Menace

  • Ace Member
  • 1,188 posts
  • RM Skill - Jack of All Trades

Posted 18 September 2012 - 10:04 AM

I have Target Manager and got no errors, although I wasn't able to toggle a skill to all enemies. I was still able to invert it to all allies though.

My Completed Scripts: http://pastebin.com/u/WCouillard

Final Fantasy Discovery: http://www.rpgmaker.net/games/4071/


#10 KilloZapit

KilloZapit

    FAIRY DUST! FAIRY DUST FOR EVERYONE! WHEE!

  • Ace Member
  • 2,557 posts
  • LocationFairyland!
  • RM Skill - Coder

Posted 18 September 2012 - 10:42 AM

Neato sweeto! I wonder if I could fiddle with this script to make scope changing grathnodes. Also I wonder if it's possible to make a scope function rather then setting the attribute...

#11 WCouillard

WCouillard

    Sanubian Menace

  • Ace Member
  • 1,188 posts
  • RM Skill - Jack of All Trades

Posted 18 September 2012 - 04:51 PM

^ I would replace the default script with that since it should have been a default feature in the first place.

My Completed Scripts: http://pastebin.com/u/WCouillard

Final Fantasy Discovery: http://www.rpgmaker.net/games/4071/


#12 Tsukihime

Tsukihime

    Advanced Member

  • Ace Member
  • 7,120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 18 September 2012 - 05:19 PM

Neato sweeto! I wonder if I could fiddle with this script to make scope changing grathnodes. Also I wonder if it's possible to make a scope function rather then setting the attribute...


Can you elaborate on what you mean by making it a function?

When I was thinking about how to make the scope system more useful, I was thinking of specifying multiple scopes.
This skill CAN hit one enemy.
This skill CAN hit one ally.

I might use something like a bit array, where 1 means "ally", 2 means "enemy", 4 means "one", 8 means "all", etc.
Then you would just take different sums, so if your scope has value 5, that means you can target "one ally", and if your scope was 13, then you could target "one or all allies".

Similarly, 1 + 2 + 4 = 7 means you can target "one ally or enemy", while 1+2+8 = 11 means you can target "all allies or enemies"

And then finally, 1 + 2 + 4 + 8 = 15 means you can target one/all allies/enemies.

So a single bit can be used to represent *how many* battlers you can target. What about the other bits?
Well, you can have a flag for "dead" or "alive" or both.
You can have another flag for "self".
You still have a whole bunch of bits available for other purposes as well, such as conditional checks and whatnot.

Rather than assign an integer to the scope and that's it, you assign an integer to the scope, and then run it through a bunch of methods to determine a list of valid targets.
All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#13 KilloZapit

KilloZapit

    FAIRY DUST! FAIRY DUST FOR EVERYONE! WHEE!

  • Ace Member
  • 2,557 posts
  • LocationFairyland!
  • RM Skill - Coder

Posted 18 September 2012 - 05:35 PM

I mean something like

module RPG
class UsableItem

def scope
# return scope here
end

def scope=(value)
# set scope here
end

end
end


I haven't had much luck doing that though, but I did fiddle around and make it set and reset the scope on the fly, as well as some other stuff:

Spoiler

Edited by KilloZapit, 18 September 2012 - 05:36 PM.


#14 Tsukihime

Tsukihime

    Advanced Member

  • Ace Member
  • 7,120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 29 September 2012 - 09:33 AM

Script now requires Tsuki Action. Scope is stored with the action and referenced from there. Just makes more sense.
All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#15 KilloZapit

KilloZapit

    FAIRY DUST! FAIRY DUST FOR EVERYONE! WHEE!

  • Ace Member
  • 2,557 posts
  • LocationFairyland!
  • RM Skill - Coder

Posted 29 September 2012 - 01:31 PM

Tee-hee... did I inspire that change? Also, you may want to put the "need_selection?" methods in "if $imported["YEA-BattleEngine"]" blocks, but I am not sure how your scope scripts will react with YEA Battle Engine now... Maybe I will try and get it working for you?

Edit: Man, it's pretty problematic getting YEA Battle Engine to work together with your scripts actualy... I think I have an idea though...

Edited by KilloZapit, 29 September 2012 - 01:54 PM.


#16 Tsukihime

Tsukihime

    Advanced Member

  • Ace Member
  • 7,120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 29 September 2012 - 01:37 PM

`need_selection?` is defined in RPG::UsableItem and is called as such whenever you select an skill/item.
All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#17 KilloZapit

KilloZapit

    FAIRY DUST! FAIRY DUST FOR EVERYONE! WHEE!

  • Ace Member
  • 2,557 posts
  • LocationFairyland!
  • RM Skill - Coder

Posted 29 September 2012 - 02:09 PM

`need_selection?` is defined in RPG::UsableItem and is called as such whenever you select an skill/item.


I know, I am just saying including all scopes in it makes some things act funny.

#18 Tsukihime

Tsukihime

    Advanced Member

  • Ace Member
  • 7,120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 29 September 2012 - 02:48 PM

I know, I am just saying including all scopes in it makes some things act funny.


Examples?

Edited by Tsukihime, 29 September 2012 - 02:49 PM.

All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#19 KilloZapit

KilloZapit

    FAIRY DUST! FAIRY DUST FOR EVERYONE! WHEE!

  • Ace Member
  • 2,557 posts
  • LocationFairyland!
  • RM Skill - Coder

Posted 29 September 2012 - 02:57 PM


I know, I am just saying including all scopes in it makes some things act funny.


Examples?


Well, mostly YEA Battle Engine assumes anything with 'need_selection?' is single target. Honestly YEA Battle Engine has lots of weird incompatibilities with your action script so it's probably not really worth fixing. Which is a shame cause I just got your target script to work with it :P Though given the way I do it is by overwriting item's scopes and resetting them later to fool other scripts.

Also one thing I tried with the action script is storing the current action in game temp and having RPG::UsableItem return the action's attributes... I donno.

Edited by KilloZapit, 29 September 2012 - 03:00 PM.


#20 Tsukihime

Tsukihime

    Advanced Member

  • Ace Member
  • 7,120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 29 September 2012 - 03:02 PM

I think it's somewhat ok to assume that need_selection? implies single target, though I assumed it just meant "do I need to show the selection window?" since that's pretty much where it's used.

My action script simply moves basically everything into the Action (and ActionScope), so unless yanfly is also modifying the action class it shouldn't be too difficult to work-around.

The main issue is the fact that the @item stored in Game_Action is a Game_BaseItem object which automatically means you're fetching from the database. This is really what I was getting away from. If it was just an RPG::Skill or Item object then I could have easily cloned a copy from the database and life is good.

Edited by Tsukihime, 29 September 2012 - 03:05 PM.

All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users