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,812
Reaction score
2,872
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
502
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,812
Reaction score
2,872
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

no I did not just have to write a song three different times because my music software doesn't support tempo changes!!
I WILL defeat this demonic USB connection notification bug
ScreenShot_8_15_2022_6_22_24.png
Mike trying to dodge the Memory Pawns invading Bantam Street. I like how the filters I used on the map almost make it look like the street is wet in a sense.
Come watch as Studio Blue plays OMORI live on the final RPG Maker Critiques stream!

The only way I can get my cat to exercise is by throwing cat treats across the room so he will run after them.

Forum statistics

Threads
124,567
Messages
1,164,448
Members
163,385
Latest member
goonfuture
Top