minmike27

Warper
Member
Joined
Sep 11, 2021
Messages
3
Reaction score
2
First Language
English
Primarily Uses
RMVXA
I don't really have any knowledge with JS but I'm tryna make an actor who uses this skill get a weapon,
this is the script call I used in a common event but its not working.

$gameActors.actor($gameVariables.value(1)).forceChangeEquip(0, $dataWeapons[10]);
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
3,800
Reaction score
2,864
First Language
EN
Primarily Uses
RMMZ
The script call looks OK to me. Ideas:
  1. Maybe the variable is not the value you think it is, so it's affecting a different actor. You can test by adding a Show Text command immediately before the script call, e.g.

    ◆Text:None, Window, Bottom : :TEST! Variable 1 is \v[1].

  2. Maybe the actor is correct, but they cannot use that weapon type. They'll need an Equip Weapon trait matching the weapon's type.
 

SGHarlekin

Veteran
Veteran
Joined
Jun 29, 2020
Messages
494
Reaction score
417
First Language
German
Primarily Uses
RMMV
I'm not 100% certain on this, but force change equip only works if you have whatever weapon you want to force equip in your inventory if I remember correctly. I had a similar issue back in the day but the memory is foggy.
 

minmike27

Warper
Member
Joined
Sep 11, 2021
Messages
3
Reaction score
2
First Language
English
Primarily Uses
RMVXA
The script call looks OK to me. Ideas:
  1. Maybe the variable is not the value you think it is, so it's affecting a different actor. You can test by adding a Show Text command immediately before the script call, e.g.

    ◆Text:None, Window, Bottom : :TEST! Variable 1 is \v[1].


  2. Maybe the actor is correct, but they cannot use that weapon type. They'll need an Equip Weapon trait matching the weapon's type.
yeah the variable value wasn't what I thought it was, i was able to fix it thank you
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
3,800
Reaction score
2,864
First Language
EN
Primarily Uses
RMMZ
I'm not 100% certain on this, but force change equip only works if you have whatever weapon you want to force equip in your inventory if I remember correctly.
forceChangeEquip skips that check, you may be thinking of changeEquip.
yeah the variable value wasn't what I thought it was, i was able to fix it thank you
Great, you're welcome! :kaohi:
 

Latest Threads

Latest Posts

Latest Profile Posts

Title Screen 100% Finished
Evangeline.png
I'm starting to enjoy doing pixel art! Not to mention it's getting easier to do commissions :kaojoy:
I'm having a surprisingly easy time with the wait for Hogwarts Legacy, though I know other gamers are salivating hard.
:awat:What are you two down there doing?
This status is here just to take up space. And to make you read that.

Forum statistics

Threads
124,360
Messages
1,163,019
Members
163,148
Latest member
Kriss_Hietala
Top