Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Weapon Unleashes V1.0

Status
Not open for further replies.
Weapon Unleashes
Version: 1.0

Introduction

This script emulates the Weapon Unleash system found in Golden Sun 1 and 2 basically when you attack with your weapon, sometimes the weapons skill is used. I have added a few things to this system (ex. the unleash will only work if a certain armor is equipped, if a certain member is in the party, if you have a certain status, hp is below a value, sp is above a value, etc.)

Screenshots

No screenshots because I feel that they are unnecessary for a script. download the demo.

Demo

http://www.rmxp.org/forums/downloads.php?do=file&id=871


Script

No, and I swear if you make a post asking for it / saying that you will not use it I will not give a reminder I will give you an infraction instead. You have been warned and this is your only warning. You should be grateful that I even post my work here and support it. Thank you for reading.

No random message dealing with families this time....

Instructions

Add it above main you will find the setup section at the top of the script. if you have any questions post

FAQ

Awaiting Question

Compatibility

SDK 2.x compliant
Requires MACL V2.0 or greater
(Required Libraries in order to run are: Actor and Party Info, Action Test, and Array.list)

Credits and Thanks

Twilight/Uzumakishade for finding the original version for me

Author's Notes

Repost of a lost script
 
Not sure if this was posted as a response to my recent request for a script that did exactly this, but you know what they say about gift horses. Thanks Trick!
 
w00t, no script? I want to see a script!
...just kidding. I was thinking about this particular script yesterday night, and I was planning to search my failed projects archive in case I had it in there.

WE ALL LOVE TRICKIE FOR SHARING HIS WORK!!!
No, seriously.

Does this work with Multi Equip? I recall that I couldn't get it to work with guillaume's multiequip. W00t about trickster's? I'm not at my pc right now, has anyone tested this?
 
It seems to be up and running fine for me. Not rigorously tested yet, obviously, but working. I do have Multi-equip and there are no conflicts, but then again, I'm not using multi-equip weapons. I'm only using it to increase the number of armor pieces worn. So that might make a difference.
 
I've been looking for this scripts for a long time now! Thanks for posting it.

I was just thinking if you can expand it, lets say even armor has a chance to auto-cast a spell when you got hit or a shield auto-casting when you defend.

Overall, great script.
 
Ravenith;232694":37gb2rdy said:
Does this work with Multi Equip? I recall that I couldn't get it to work with guillaume's multiequip. W00t about trickster's? I'm not at my pc right now, has anyone tested this?

It should, I do take in account most of my previously written scripts

but with this one the unleash will only work with the first weapon you equip (meaning the weapon in slot 1), it would have been a harder script if I did something else

@Mimi - I may consider it
 
How do I set the skill to be used, and the rate it will be used at?

OK, just to carify I have read the script, I see how skills are randomly generated etc.... but after about a long time I cant seem to figure out hwo to make say and Ice Knife just use snowball skill.

Mind you Ive only been using RMXp for about like 2 days nnow...
and Im a VB programmer for psychology too....so I such and might need a hint here
 
All the good scripts go to SDK =[. Very nice script though! I love it, maybe this could be a good basis for a command input system? Such as X X = Double Slash, not requesting it though, just a though.
 
cainchild;242190":3s5kbfjj said:
How do I set the skill to be used, and the rate it will be used at?

OK, just to carify I have read the script, I see how skills are randomly generated etc.... but after about a long time I cant seem to figure out hwo to make say and Ice Knife just use snowball skill.

Mind you Ive only been using RMXp for about like 2 days nnow...
and Im a VB programmer for psychology too....so I such and might need a hint here


Hmm lets see if I can go over this

you see the top of the script where it says module Unleash that is the setup section

Code:
 #--------------------------------------------------------------------------
  # * Requirements
  #     syntax weapon_id => [ requirements ]
  #
  #     Rnn  random nn is the chance of success
  #     Ennn armor nnn has to be equipped
  #     Snnn skill nnn must be learned
  #     Innn item nnn must be in possession
  #     Dnnn item nnn must be in possession used after unleash
  #     Lnnn must be at least level nnn
  #     Cnnn character nnn must be in the party
  #     Unnn user must be character nnn
  #     Hnn health must be below nn%
  #     Mnn magic must be below nn%
  #     Tnn state nn must be inflicted
  #--------------------------------------------------------------------------
  Requirements = {1 => ['R80'], 25 => ['R50']}

Here is the requirements needed for the unleash skill to work the syntax is given in this line syntax weapon_id => [ requirements ]

what that means is the id of the weapon (from the database) followed by an => and then an array of requirements (the [ ] denotes an array in ruby)

now the requirements are given and they must be a string (use '' or "" to create a string)

Code:
  #     Rnn  random nn is the chance of success
  #     Ennn armor nnn has to be equipped
  #     Snnn skill nnn must be learned
  #     Innn item nnn must be in possession
  #     Dnnn item nnn must be in possession used after unleash
  #     Lnnn must be at least level nnn
  #     Cnnn character nnn must be in the party
  #     Unnn user must be character nnn
  #     Hnn health must be below nn%
  #     Mnn magic must be below nn%
  #     Tnn state nn must be inflicted

for example 'R40' is a 40% chance 'H30' is health below 30% etc.
to have multiple requirements just use a comma between entries

so...

Requirements = {1 => ['R80'], 25 => ['R50']}

(the { } denotes a hash which maps a key to a value, also entries in a hash are also separated by a comma)

weapon id 1 has a 80% chance of unleashing and weapon id 25 has a 50% chance of unleashing

Requirements = {5 => ['R80', 'I1', 'D2', 'L5']}

this means that weapon id 5 has a 80% chance of unleashing but the hero must possess item id 1 and item id 2 (item id 2 is used) and must be level 5 only then will the unleash work

Code:
 #--------------------------------------------------------------------------
  # * Skills
  #     syntax weapon_id => [ skills ]
  #--------------------------------------------------------------------------
  Skills = {1 => [59], 25 => [2, 3]}

here is where you define what skill is actually unleashed the syntax is the weapon id from the database then => and then an array of skill ids that can be unleashed

Code:
  #--------------------------------------------------------------------------
  # * Messages
  #     syntax weapon_id => message
  #     [skill] = skill name, [weapon] = weapon name
  #--------------------------------------------------------------------------
  Messages = {}

here is where you set up the optional message that appears in the help window if the skill is unleashed the syntax is the weapons id from the database followed by => and then a string denoting the message displayed if you type [skill] or [weapon] anywhere in the string it will be replaced by the skills name or weapons name respectively

Code:
 #--------------------------------------------------------------------------
  # * Default Message
  #--------------------------------------------------------------------------
  Messages.default = '[weapon] lets out a howl [skill]!'

And here we have a default this is in case you forgot to define a weapon id in the hash above (or a easy way to not define anything and let the default handle the work) but if the weapon isn't in the above hash then it will display that message you see there

Code:
 #--------------------------------------------------------------------------
  # * Use Sp
  #     Use Sp when unleashing weapon skill?
  #--------------------------------------------------------------------------
  Use_Sp = false

Set this to true if you want the sp to be used if a skill is unleash otherwise set it to false

Code:
 #--------------------------------------------------------------------------
  # * Kind
  #--------------------------------------------------------------------------
  Kind = 5

you shouldn't worry about this unless you know what it does.

but yeah I think I went a little overboard in trying to answer your question if you need anything else just ask :)


Gustave;242449":3s5kbfjj said:
All the good scripts go to SDK =[. Very nice script though! I love it, maybe this could be a good basis for a command input system? Such as X X = Double Slash, not requesting it though, just a though.

ummm actually I got the requirements wrong for some reason :-/. It only requires Part I of the SDK you don't need parts II or III which may break other scripts. but thanks for your comment nonetheless
 

Zxiggy

Member

howcome it works when i play your demon, but when i copy scripts (rxdata) and replace my own in my game it just doesnt bloody work!
 
I get an error when i dont use any weapon.

Script: 'Weapon Unleashes' Line: 160 Type Error Ocurred.
No implicit conversion from Nil to Integer.
 
Script 'Weapon Unleashes' line 79: NoMethodError occured.
undefined method `random' for nil:NilClass

what does this mean?
 

Sodon

Member

JXROOK;264313 said:
Script 'Weapon Unleashes' line 79: NoMethodError occured.
undefined method `random' for nil:NilClass

what does this mean?

I received the same error. This occurred during battle, when a weapon skill was about to be unleashed (the weapon was set to use the skill 100% of the time).

The 'random' method seems to be in the Array.list script, which I copied over... Hmm.
 
Status
Not open for further replies.

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top