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

Well, I've got a party tomorrow, and my friends are coming over. I wanted to work a bit on the Fandom Scouts assets so I can be ready when that update arrives... in other news, Pizza Time Horror is getting a second teaser, and it shows Cabaret Helen's last performance before the location closed.
Also who used to be scared of Chuck E as a kid? I was! Now I love him!
The new cards and what they do:

(I am clearly not a youtuber... Haha)
Just for the record you CAN use the "Exclude unused files" successfully to trim a project down seriously even if you're doing calls to various assets via plugins and such. BUT you need to do a full playtest of pretty much every option to ensure you did get every one of those other assets added in. Then I dumped the assets into a fresh copy of the project and yay it was like 400 Meg......
party time.png
If you've played Knight Shift Chapter 1 this image'll mean something to you. If not, that's also fine!

Forum statistics

Threads
117,269
Messages
1,105,986
Members
153,445
Latest member
sweetchi
Top