Morizel

Veteran
Veteran
Joined
Sep 28, 2018
Messages
112
Reaction score
8
First Language
Russian
Primarily Uses
RMMV
How to check equipment nor on specific actor, neither on all actors in party, but on any (no need to check specific actor's ID) actor in the party?
I want to make event includes with next conditional banch: "IF at least one character in party wears Chaimail (armorID 5), then happens A, else B".
As example, the door opens only when somebody in the player's party wears Jeweled Sword or Magic Armor.
 

NhatNguyen

Peaceful Days Dev
Veteran
Joined
Sep 19, 2013
Messages
274
Reaction score
842
First Language
Vietnamese
Primarily Uses
RMVXA
You can give this a try
HTML:
◆Script:var item = $dataWeapons[2]; //$dataArmors[2]
:      :this._isEquipped = $gameParty.members().some(function(a){
:      :  return a.isEquipped(item);
:      :})
◆If:Script:this._isEquipped
  ◆Text:None, Window, Bottom
  :    :Okay!
  ◆
:Else
  ◆Text:None, Window, Bottom
  :    :...
  ◆
:End
 

FleshToDust

Veteran
Veteran
Joined
Jul 10, 2017
Messages
805
Reaction score
2,914
First Language
English
Primarily Uses
RMMV
Couldn't you event that? Have a door say "If x equipped on Member A, open door, else, Member B, C, D, else Show Text: Locked"
I did that with event's before. Had a training area where you couldn't enter unless you had a Practice Weapon equipped.
 

Morizel

Veteran
Veteran
Joined
Sep 28, 2018
Messages
112
Reaction score
8
First Language
Russian
Primarily Uses
RMMV
Couldn't you event that? Have a door say "If x equipped on Member A, open door, else, Member B, C, D, else Show Text: Locked"
I did that with event's before. Had a training area where you couldn't enter unless you had a Practice Weapon equipped.
Well, I thought there was a script, like checking the entire party for the having of a particular state:
Code:
$gameParty.aliveMembers().every( function(member) {return member.isStateAffected (N) } )
Or like a script that checks to see if at least someone in the party is in a state:
Code:
$gameParty.allMembers().some( function (actor) {return actor.isStateAffected (State ID) } );
 

Silva

Scoobityboo
Veteran
Joined
Nov 5, 2018
Messages
402
Reaction score
225
First Language
English
Primarily Uses
RMMV
You can condense what @dsiver144 wrote into a single line for using in the same manner as you have been for states like so:

Code:
$gameParty.members().some(function(actor){return actor.isEquipped($dataArmors[5])})

Likewise, this will work with the every() method as well.
 

Morizel

Veteran
Veteran
Joined
Sep 28, 2018
Messages
112
Reaction score
8
First Language
Russian
Primarily Uses
RMMV
You can condense what @dsiver144 wrote into a single line for using in the same manner as you have been for states like so:

Code:
$gameParty.members().some(function(actor){return actor.isEquipped($dataArmors[5])})

Likewise, this will work with the every() method as well.
Okay, what's wrong am I doing?
I tried to make a lamp item using Terrax Lighting plugin.
capture_003_18122019_234003.jpg
The item was realized as armor item 17. But ingame it doesn't work. Although the switch is on.
 

Silva

Scoobityboo
Veteran
Joined
Nov 5, 2018
Messages
402
Reaction score
225
First Language
English
Primarily Uses
RMMV
I can't be sure what's going wrong - I can't see the whole of the condition, but assuming you've changed the "5" to "17" and everything else is an exact copy of what I posted previously the code should be working.

My first concern is that this is set up as a looping parallel event but doesn't seem to be doing anything that requires being executed 60 times a second. I'm not sure how this lighting plugin works but if it has an animation to turn on the light over time it's possibly getting interrupted by starting the process all over again every time the plugin command is called. I'd advise turning off switch 1 at the end of your event so it only executes once.

If that doesn't work can you confirm that the "Plugin Command: Tint set #111111" is working properly? If it is, add a show text before "Plugin Command: Fire radius 110 #FFFFFF" - add any text you want - and run a playtest. If the text appears then the condition is working and it's probably worth checking you have the lighting plugin set up properly. If it doesn't then please show me the whole script you're using.
 

Morizel

Veteran
Veteran
Joined
Sep 28, 2018
Messages
112
Reaction score
8
First Language
Russian
Primarily Uses
RMMV
I can't be sure what's going wrong - I can't see the whole of the condition, but assuming you've changed the "5" to "17" and everything else is an exact copy of what I posted previously the code should be working.

My first concern is that this is set up as a looping parallel event but doesn't seem to be doing anything that requires being executed 60 times a second. I'm not sure how this lighting plugin works but if it has an animation to turn on the light over time it's possibly getting interrupted by starting the process all over again every time the plugin command is called. I'd advise turning off switch 1 at the end of your event so it only executes once.

If that doesn't work can you confirm that the "Plugin Command: Tint set #111111" is working properly? If it is, add a show text before "Plugin Command: Fire radius 110 #FFFFFF" - add any text you want - and run a playtest. If the text appears then the condition is working and it's probably worth checking you have the lighting plugin set up properly. If it doesn't then please show me the whole script you're using.
I'm sorry, my bad. It's already working.
I was just confused that I can't turn light script off in the map.
 

Latest Threads

Latest Profile Posts

7DcJlIG.png


Made a lot of progress on the tileset for the more sumptuous interior areas for the priory
I keep thinking up of new changes or improvements... Edit: Forgot to add the image Gimpwork.JPG
Hello, my nickname is Rigomor, but I am also known as Mopsikus. I work on RPG Maker games, and are currently working on a game called Peony of War.

Forum statistics

Threads
117,299
Messages
1,106,293
Members
153,480
Latest member
Varlen
Top