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.

Grab Bag of Script Requests (Updated Presentation)

Naze's Grab Bag of Script Requests

Introduction:

While I'm making my RPG in RPG Maker XP, I frequently find myself stuck due to rather minor issues which are beyond my knowledge to overcome. I find myself considerably good with eventing, so I'm 98% sure these can't be done with events. So, after getting frustrated and discouraged, I decided that I should just post some requests. Since I think these scripts should be small, I compiled them into one request thread. I've checked several sites for similar scripts, but haven't found any. Also, I don't lay claim to these scripts, so feel free to use them if they become incarnate. To avoid a huge first post, I've put them in spoilers. Remember that these scripts are ALL for RPG Maker XP.


Revert to Unequipped
(Completed by shadow32o*)


Revert to Unequipped:

To install this, read it as a common event.

Code:
@>Conditional Branch:Script: $game_party.actors[0].weapon_id == 0
   @>Change Weapons: [Weapon Name] + 1
   @>Change Equipment: [Actor Name], Weapon = [Weapon Name]
   @>
  :  Else
   @>Change Weapons [Weapon Name] - 1
   @>
  :  Branch End
@>

This should make it so when a character has no equipment in a particular slot, a replacement equipment is automatically put in it's place.


Targeting With Common-Event Attacks

Targeting With Common-Event Attacks

What I mean is, I like to make effects for skills, using common events. The only problem with this is that you can't target an enemy with a common event. Allow me to explain:

  • So, I want to make an attack called gravity. This attack should deal damage to one enemy, depending on his weight.
  • First, we need to target an enemy for the attack. I can't do this with events.
  • Next, we find out how much damage that attack does. We do this by identifying what type of enemy we're attacking. I can't do this either.
  • Then we set conditional branches to check what type of enemy we're fighting. We set the damage for each one.
  • We deal the damage to the enemy we targeted. Uh-oh, I can't do that either!
  • Finally, we need to display the damage done. Once again, I can't do this.

Hope that you understand... Here's a common event I made that demonstrates how I would write the spell. A lot of it needs scripts to affect the target, since the normal events don't allow the target to be a variable.

http://img266.imageshack.us/img266/2697/capturedyz0.jpg[/img]


In-Game Class Modifications

In-Game Class Modifications

In my game, the player can "Create his class." This means that he can name his class, and add or remove any weapon and armor proficiencies. (A "Proficiency" is an ability to use that weapon or armor. You set these on the "Classes" tab of the database) I can't do either of these in-game!

Naming the Class:

When the character names his class, it should look like the "Name Input Processing" window. that is, like this:

http://img523.imageshack.us/img523/4712/nipqp1.th.jpg[/img]http://img523.imageshack.us/images/thpix.gif[/img]

His class should be able to have an eight-symbol name.


Setting the Proficiencies:

Setting the proficiencies has no visual component. It's all done behind-the-scenes. What happens is, he selects a skill on level-up (No scripts involved) that's called "Sword Proficiency." This turns on a variable that tells the game that the class can use swords! The class doesn't change, so it's always the same number in the database.

*The system used does not update the inventory until the menu is exited. This should be solvable by allowing common events to run behind the menu. Help for this is appreciated, but not required.
 
I think this might be what you want for your "Revert to Unequipped"

Code:
@>Conditional Branch: $game_party.actors[0].weapon_id == 0
           @>Change Weapons: [Weapon Name]+ 1        
           @>Change Equipment: [Character Name], Weapon = [Weapon Name]
           @>
         : Else
           @>Change Weapons: [Weapon Name]-1
           @>
         : Branch End

What this will do is check the character to see if he/she has no weapon equipped. If that is true, it will add a weapon (you need to create one) to your inventory and automaticly equip it. Then if you equip a sword (or other weapon) it will remove the weapon from your inventory again untill there is no weapon equiped. To make things easier, you can put this in a common event and have an event run parellel process with that event in it. There probably is a script for this, but this is the best I could do (I'm not much of a scripter) Hope this will help. 

Edit: Note, the changes (Weapon being equiped when no weapon is present) don't actually show untill you leave the equip screen or inventory.
 
Please Accept my Apologies...

I am sorry it took me so long to reply to the topic, but for some reason I have not received any E-mail notifications...

But anyway, I have progressed in my game to the point where I NEED these scripts to continue. The requirements are the same as always. Please don't make give up my work.

And lastly, in response to Shadow, the script looks like it should work, but I get a Syntax error whenever I try it. It could be that I misinterpreted how to use it, so please clarify your description. I used it a common event, using the "Script" command, but I encountered a limit. The command only allows 11 lines of up to 38 characters. Your script isn't within that limit.

I hope the topic progresses smoothly from here on.
 
I'll take a look at these because you did a decent job on organizing your request. :)

1) Unequipped
What exactly are you wanting? I am a little confused at your explanation. When they don't have a weapon equipped, what happens? They gain a skill, or a default weapon is equipped?

2) I think I know what you are saying. How about this, when you use a skill on a target, it saves a variable to the enemies position in the enemy troop?

Code:
class Game_Battler
  Common_Event_Target_ID = 1
  alias_method :seph_cet_gmbtlr_se, :skill_effect
  def skill_effect(user, skill)
    if self.is_a?(Game_Enemy)
      $game_variables[Common_Event_Target_ID] = self.index
    end
    seph_cet_gmbtlr_se(user, skill)
  end
end

Ok. Now when you use a skill on an enemy, it saves one of the game variables to equal the member index in the target party. Hope that's what you needed.

3) CPG: No script exist and I don't exactly have the time for this. You might want to try a visual equipment system. Probably the closest you are going to get.

4) Changing class
The thing with this is you change any class specifications, it changes it for all players in your game, not one person. You can use my virtual database system if thats what you are wanting to do. Oherwise you'll need to clone $data classes and modify them on the fly, a slightly more complex concept. You can use my virtual database for this as well, but still not a simple concept to accomplish.
 
Hey buddy, I'll help you with this:

3) I have a script in Visual Equipment that corresponds exactly to that.

4) I also have a script for Class Change, I do not know whether you have all these functions.

The Problem) I'm not at home at the time, but just put the demos of these scripts for you. You can wait.
 
I am sorry it took me so long to reply to the topic, but for some reason I have not received any E-mail notifications...

But anyway, I have progressed in my game to the point where I NEED these scripts to continue. The requirements are the same as always. Please don't make give up my work.

And lastly, in response to Shadow, the script looks like it should work, but I get a Syntax error whenever I try it. It could be that I misinterpreted how to use it, so please clarify your description. I used it a common event, using the "Script" command, but I encountered a limit. The command only allows 11 lines of up to 38 characters. Your script isn't within that limit.

I hope the topic progresses smoothly from here on.

Its not really a script...its more of an event.

What its using is a conditional branch, what you want to do is go to the fourth tab ( i think thats the section) and put: "$game_party.actors[0].weapon_id == 0" (no quotes) as the condition. That should check to see if you have a weapon equiped or not. Then after you press ok, right bnelow conditional branch

The below are not scripts! They are events that you insert below the conditional branch part.

put this piece in :
Code:
Change Weapons: [Weapon Name]+ 1
below that, put this in :
Code:
Change Equipment:[Character Name], Weapon = [Weapon Name]

then you will see "else"(no quotes)

below that, insert these events

Code:
Change Weapons: [Weapon Name]-1

The final product should look like this...

Code:
@>Conditional Branch: $game_party.actors[0].weapon_id == 0
           @>Change Weapons: [Weapon Name]+ 1        
           @>Change Equipment: [Character Name], Weapon = [Weapon Name]
           @>
         : Else
           @>Change Weapons: [Weapon Name]-1
           @>
         : Branch End


Recap: 1)Use a conditional branch
          2)Set the condition as:
Code:
$game_party.actors[0].weapon_id == 0
(one thing I may have  left out by accident, the "0"s are where the id of actor (1st "0") and weapon (2nd "0") go.
           3)Everything below "conditional branch are events, not mini scripts.


Hope this helps clear things up...Good Luck :grin:

   
 
Wow! Thanks guys! More responses in under 12 hours than in 12 days? Cool.

Anyway, responding in the appropriate order...

  • Sephiroth Spawn:

                   1) Shadow's idea works pretty well for this, but I'll explain anyway. When a piece of equipment is unequipped, leaving nothing in the slot, there should be a replacement item. For example, when Aluxes unequips a Bronze Sword, his equipped item changes to "Unarmed." That should be easy enough, and I found a lot of similar scripts, but the trick is to have the system for all equipment slots, (E.G. Armor, Helmet, Weapon...) and have the replacement item change depending on a variable, for each character (I.E. 'If "Aluxes Skill" = 1' than the replacement item is "Unarmed." 'If = 2' than it becomes "Improved Unarmed.") I don't want a huge post, so If you need me to explain more could I send you a PM?

                   2) I'll have to try that... One question though... Where do I put this? Somewhere in the 'Game_Battler' classes, but where? Also, you seem a little skeptical as to what I'm requesting. Basically, I want to target an opponent with a common event, and record a variable depending on the selected target when I use that common event. I do the rest. The variable I want is the enemy ID. That's the ID of the enemy's position on the field, so to speak. The second one that would allow me much more attack possibilities is the database ID of the targeted enemy. Once again, can I PM if you need more info?

                   3) No problem. Like I said, it's not required, and I can do it myself with an event... a big one. But I may not use this at all, so I may take it off soon, once my decision is final.

                   4) Sure, I'll try that. But I can't seem to find out where in the script to put my modifications. Do you remember? The thread is from 2006.

  • Benilton:

    Thanks, I'll be waiting!

  • Shadow:

    My bad... I feel like a noob... It works great except for the updating problem you mentioned. Not game-killing for sure, so I'll still use it. Thanks! Just a few questions: how do you change the actor being checked for equipment? And how do you change the equipment slot being checked? I'll credit you once I get these statistics. Is "shadow32o" under "Game Mechanics" O.K.?
 
Shadow:

My bad... I feel like a noob... It works great except for the updating problem you mentioned. Not game-killing for sure, so I'll still use it. Thanks! Just a few questions: how do you change the actor being checked for equipment? And how do you change the equipment slot being checked? I'll credit you once I get these statistics. Is "shadow32o" under "Game Mechanics" O.K.?

Checking actor (this is a little different, may glitch up if you don't do it like it is below)

Code:
@>Conditional Branch: [character name] is in the party
   @>Conditional Branch: Script: $game_party.actors[actor id].weapon_id == 0
       @>Change Weapons: [Weapon] +1
       @>Change Equipment: [other character name], Weapon = [Weapon name]
       @>
:      Else
       @>Change Weapons: [Weapon] -1
       @>
:      Branch End

This is 2 conditional branches in one. The first one checks to see if the character is in your party (may glitch up if you don't have that) Then the second conditional branch has the mini script to check weapon id. Where it says "actor id" change that to a number between 0 - the amount of characters you have.(Need a new conditional branch for each character, make sure to put each new on below or on a new line and not in the same one as actor 1 for instance.

0=first actor
1=second actor
etc.

everything should be pretty much the same after those 2.

Unfortunatly....since I'm not too good at scripting, I am unsure how to get it to check different slots...I thought that "$game_party.actors[actor id].helmet_id == 0"(or something like that) would work, but the id is stored elswhere for those and I don't know how to right the mini code to find that...srry :cry:

and if you still want to credit me, "shadow32o" under "game mechanics" would work.  :grin:
 
Sure thing. Not to worry about checking the other slots. I looked into it, and the correct terms are armor1 for shields, armor2 for armours, armor3 for helms, and armor4 for accessories. You did good on this. It's easy and nearly perfect.
 
Sorry to say, but you've got the wrong platform. It says in the main post that the scripts are for XP. Also, no, that's not what I was looking for with the classes. The ability for the player to name the class, and change it's armor/weapon proficiencies was what I was looking for. Thanks for trying.
 
*Bump*

I haven't yet got a response to SephirothSpawn's post, and an answer to that may be the answer to the rest of my problems. Also, I've removed the player graphic request from the main post. Please disregard any information regarding a "Custom Player Graphics."
 
*Bump*

It doesn't have to be sephiroth that responds. It could be anyone who has knowledge of scripting. Just read his post - It has a few good leads. Then, of course, read the questions that need answering. Please help. They're almost finished!
 
...

Please help me out. I've came up with about 50 skills that require "Targeting With Common-Event Attacks," so I'm not about to give up.

And remember, some of the other posts have leads that you could start at, so read them, if you don't normally.


EDIT: It seems that there is something about this thread that turns people away. I would appreciate it if anyone would tell me what it is, so I may fix it, and have this request filled.
 

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