Chaos Project

RPG Maker => RPG Maker Scripts => Script Requests => Topic started by: Wraith89 on November 18, 2014, 07:45:19 pm

Title: [Resolved] Regarding Ryex's Unleash Skill Script
Post by: Wraith89 on November 18, 2014, 07:45:19 pm
While the script works perfectly, is there any way to make it so that a character without weapon does not automatically crash the game? I have tried methods such as adding unless statements where actor's weapon is nil, but that was to no avail and it gives me "cannot convert to integer" error or something.

Thank you.
Title: Re: [XP] Regarding Ryex's Unleash Skill Script
Post by: KK20 on November 18, 2014, 08:35:36 pm
Line 86:

unless @active_battler.weapon_id == 0 || $data_weapons[@active_battler.weapon_id].unleash_chance(@active_battler.weapon_id) == false

I'll actually fix that up for him.

EDIT: Main post updated.
Title: Re: [XP] Regarding Ryex's Unleash Skill Script
Post by: Wraith89 on November 18, 2014, 08:51:00 pm
Thanks a lot! So || is an indicator of "or" instead of "and" for something to work?
Title: Re: [Resolved] Regarding Ryex's Unleash Skill Script
Post by: KK20 on November 18, 2014, 09:13:02 pm
Uh...I'm going to say yes.

You can replace || with 'or' if you want to. Just remember that && and || have a higher priority level than 'and' and 'or'. And by priority level I mean like how you multiply numbers first before you add/subtract them in an equation.
Title: Re: [Resolved] Regarding Ryex's Unleash Skill Script
Post by: Wraith89 on November 18, 2014, 09:17:50 pm
So it is simply order of operation differences. That clears up a lot of things. Thank you very much!