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,811
Reaction score
2,870
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
499
Reaction score
424
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,811
Reaction score
2,870
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 Profile Posts

I finally finished the Coliseum for my game. Love how it looks. Credits for the assets goes to Kokoro Reflections, @Starbird_Resources, and @megumi014.
Colossuem.png
Mimics! Mimics everywhere!
Pirate portrait quickie :LZYcheeze:
pirate.png
My game has a (much needed) tutorial now...
Game Making Every Day #20:kaohi:

Forum statistics

Threads
124,511
Messages
1,164,157
Members
163,345
Latest member
Issentia
Top