Hime-Works / Requests

Bug reports and requests that may require longer discussions and is not suitable to leave on the blog
http://himeworks.com/
GNU General Public License v2.0
7 stars 9 forks source link

ACE Command Manager -- Having conditionally-enabled skills types? #318

Open rubydragon44 opened 8 years ago

rubydragon44 commented 8 years ago

The project I'm currently working on is a dungeon-crawler where you get to choose your race and class. Yet you also get to choose two classes, so having class-tag-dependent command tags doesn't really work for what I'm trying to do, since you could mix the Barbarian and Wizard class and still have access to the LV 1-6 spell lists. So, I decided to have stypes be conditional and generally added via a state when a given actor chooses to learns a skill of a certain stype, in an unrelated process. To test, I tried adding a state, State 26, that adds the Stype 3 "LV 1 Spells" and then putting the tag cmd: skill_list in a given actor's Notes box, but found that apparently you can't add stypes through state traits, with or without this script. I instead tried using Feature Conditions, the first feature being Add Stype 3 (LV 1 Spells) with a condition being a.state?(26). At turn 0 I added State 26, checked my actor's command list, and they still didn't have the "LV 1 Spells" command. So, for my last attempt I tried modifying the Command Manager script, making the adjustment class Command_Skill < Game_BattlerCommand def enabled?(user) [3,4,5,6,7,8].each {|i| if @ext == i then if !user.state?(23+i) then return false end end} true end end added State 26, and yet it still wouldn't work correctly. So, I wanted to see just what goes on in the Command_Skill process, so I did class Command_Skill < Game_BattlerCommand p "name #{@name}" p "symbol #{@symbol}" p "ext #{@ext}" end and it just returned "name " "symbol " "ext " which is weird since I figured it'd be printing multiple instances for multiple stypes.

So I guess I could either ask for assistance in making states be able to add stypes, or ask for assistance in modifying the usable?(user) and enabled?(user) aspect of stypes

HimeWorks commented 8 years ago

Modifying usable? is the recommended way.

rubydragon44 commented 8 years ago

Usable doesn't change whether or not a command list is shown or not, just if it's selectable. I wouldn't want an actor who solely chose the Barbarian class to be able to see the "LV 6 Spells" command, but I wouldn't want to have the "LV 6 Spells" command tied to the casting classes because if you multi-class, you can eventually have access to spells provided your spellcasting class level is high enough, and because the way I'm making the game, your current selected class doesn't change anything, just which classes you have levelled up. And you for some reason can't have stypes added via states or have them appear-mid battle via a feature condition, so that's why I'm stumped. Since conditioning @symbol == "skill" doesn't seem to work for me, I guess I could just condition for @ext == (range of numbers) and have it so that no use_skill tags will be within this range of numbers. I don't plan to use use_item tags so I don't have to worry about item use commands being within the range of conditional stypes

HimeWorks commented 8 years ago

Oh, in that case use the enabled? method, which controls whether it should be shown or not.

rubydragon44 commented 8 years ago

Yes, but as I was saying, the problem with enabled? for Command_Skill is that I can't seem to condition whether @symbol == "skill", as it always results false, whereas @symbol == skill results in an undefined error

HimeWorks commented 8 years ago

Please print out the symbol to see what it is. On Dec 12, 2015 11:47, "rubydragon44" notifications@github.com wrote:

Yes, but as I was saying, the problem with enabled? for Command_Skill is that I can't seem to condition whether @symbol https://github.com/symbol == "skill", as it always results false, whereas @symbol https://github.com/symbol == skill results in an undefined error

— Reply to this email directly or view it on GitHub https://github.com/Hime-Works/Requests/issues/318#issuecomment-164167521 .

rubydragon44 commented 8 years ago

That's what I tried to do I added p "Symbol: #{@symbol}" to Command_Skill and it returned "Symbol: skill" yet @symbol == "skill" for Command_Skill returns false. I think it has something to do with the fact that p "#{data}" removes extra quotation marks or whatever, so I can't fully tell what @symbol actually is.

HimeWorks commented 8 years ago

Try

:skill On Dec 12, 2015 13:40, "rubydragon44" notifications@github.com wrote:

That's what I tried to do I added p "Symbol: #{@symbol https://github.com/symbol}" to Command_Skill and it returned "Symbol: skill" yet @symbol https://github.com/symbol == "skill" for Command_Skill returns false. I think it has something to do with the fact that p "#{data}" removes extra quotation marks or whatever, so I can't fully tell what @symbol https://github.com/symbol actually is.

— Reply to this email directly or view it on GitHub https://github.com/Hime-Works/Requests/issues/318#issuecomment-164175264 .