Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

Script for Party Leader equipped weapon(Solved)

Status
Not open for further replies.
Hello and thank you for taking time out of your day to help me.
I need two things thats sort of related.

I searched and searched I think I found some answers but how to use the answers is not quite what I need.
I found this https://docs.google.com/spreadsheets/d/1-Oa0cRGpjC8L5JO8vdMwOaYMKO75dtfKDOetnvh7OHs/edit#gid=0

which shows you a bunch if not all of the script calls. What I need is something like this:
------------------------
1.
$gameParty.leader().name() <- this finds the name of the party leader and I can set up conditions with it.
I need a script like that for the weapon that is equipped by the party leader.
Not weapons by ID number and actor.
If thats possible I need it for the armor thats equipped and skill the leader has also.

2.
$gameParty._actors.push($gameParty._actors.shift());
$gamePlayer.refresh();
$gameMap.requestRefresh();
This switches formation of the party leader and I can attach it to a button press

However I need to switch weapons and skills by button press.

-----------------------
Thanks again
 

CT_Bolt

Global Moderator
Staff member
Resource Team
Xy$
0.02
Hmm... let's see...

Part 1:
Code:
// n = the equipment slot starting at 0;
var n = 0;
$gameParty.leader().equips()[n].name
Replace "name" with any of the following:
atypeId, animationId, description, etypeId, iconIndex, id, name, note, price, wtypeId
Here are the variable types for each:
  • atypeId: integer
  • animationId: integer
  • description: string
  • etypeId: integer
  • iconIndex: integer
  • id: integer
  • name: string
  • note: string
  • price: integer
  • wtypeId: integer
Sidenote: There are other options such as traits and params but that's for another time.

atypeId is for armor & wtypeId is for weapons.
If the equipped item is a weapon it won't have an atypeId it will only have a wtypeId.

As for skills...
Code:
// n = the skill slot starting at 0;
var n = 0;
$gameParty.leader().skills()[n].name
Replace "name" with any of the following:
animationId, damage.critical, damage.elementId, damage.formula, damage.type, damage.variance, description, hitType, iconIndex, id, message1, message2, mpCost, name, note, occasion, repeats, requiredWtypeId1, requiredWtypeId2, scope, speed, stypeId, successRate, tpCost, tpGain
  • animationId: integer
  • damage.critical: boolean
  • damage.elementId: integer
  • damage.formula: string
  • damage.type: integer
  • damage.variance: integer
  • description: string
  • hitType: integer
  • iconIndex: integer
  • id: integer
  • message1: string
  • message2: string
  • mpCost: integer
  • name: string
  • note: string
  • occasion: integer
  • repeats: integer
  • requiredWtypeId1: integer
  • requiredWtypeId2: integer
  • scope: integer
  • speed: integer
  • stypeId: integer
  • successRate: integer
  • tpCost: integer
  • tpGain: integer
Part 2:
Code:
// Assign an item to a equipment slot using Weapon/Armor ID
var slot_index = 0;
var item_id = 10;
$gameParty.leader()._equips[slot_index]._itemId=item_id;

// $gameParty.leader()._equips[slot_index]._dataClass
// Above is a string to set to "weapon" or "armor" depending on what is equipped.

// Assign a skill to a skill slot using skill ID
var slot_index = 0;
var skill_id = 10;
$gameParty.leader()._skills[slot_index]=skill_id;
I trust you already know how to attach this to a button press?

Let me know if this helps. (cool)
 
Last edited:
it absolutely did thank you soooooooooooooooooooo much and sorry for the late response. Sometime I get discourage and stop working on the game for a while.
 

CT_Bolt

Global Moderator
Staff member
Resource Team
Xy$
0.02
it absolutely did thank you soooooooooooooooooooo much and sorry for the late response. Sometime I get discourage and stop working on the game for a while.
Thought I replied and closed this lol... but I must not have. (facepalm)
That's awesome to hear you've got it working. Sounds like a really fun game feature. (icecream)

I too understand what it is like to get discouraged. (perplexed) Sometimes it helps to take a small break and come back to it. (cute)

Anyways...

Thread closed due to this being solved. Happy Game Making!
 
Status
Not open for further replies.
Top