Is there a way to find out what an actor has equipped?

Danny Mezzina

Villager
Member
Joined
Jul 16, 2012
Messages
18
Reaction score
0
First Language
German
Primarily Uses
Hi everyone!

I am experimenting with a couple of ideas right now, and am encountering a problem.

I want to display a picture on the screen depending on what an actor or party member has equipped.

Basically I need to get the weapon or armor id and attach it to a variable, but I cant seem to find a way in engine to do so.

Is there actually a way of doing this or would I need a script? and if so, is there already a script that does that?

(Or a way without using variables would be fine too, basically anything that can do that is great^^)

Thanks in advance!
 

Danny Mezzina

Villager
Member
Joined
Jul 16, 2012
Messages
18
Reaction score
0
First Language
German
Primarily Uses
I think I can do it with a conditional branch, but would be kinda horribly extensive to do^^

So still if there is an easy way for this I would very much appreciate the help :)
 

Cadh20000

Veteran
Veteran
Joined
Sep 15, 2013
Messages
1,828
Reaction score
445
First Language
English
Primarily Uses
Watch out, they are very strict here so try to edit your previous post rather than double post unless you are bumping a request thread that has gone 3 days without a response.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Danny Mezzina, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


Do you want to call this from a script or from an event?


If from a script, take a look at Scene_Equip and its windows. That shows each item the character currently has equipped.


If from an event, you'll need to use Control Variables, choose your variable, then use the Script box to get the piece of equipment. Or if you want to use it in a conditional branch, you can bypass the variable altogether.


You would use $game_actors[id] or $game_party.members[index] to get the character, then the .weapons, .armors, or .equips method on that character to get the list of equipment. That will return the item itself (a $data_weapons or $data_armors item), not just the id.
 

Danny Mezzina

Villager
Member
Joined
Jul 16, 2012
Messages
18
Reaction score
0
First Language
German
Primarily Uses
First thank you both for the advice about the double post, I was not aware of that and no spamming was intended,

I am very sorry!

Shaz thank you very much for that advice, I am not entirely sure I know how to use that though, but I will try and the pointer sure is helpful!
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
The reason I cannot be more specific about how to do it is because your question is a bit ambiguous, once you start looking into the possible solutions. And you didn't answer my question from my last post, about whether you want to do this in a script, or in an event, which will also change how you do it.


Let me explain:

I want to display a picture on the screen depending on what an actor or party member has equipped.


Basically I need to get the weapon or armor id and attach it to a variable, but I cant seem to find a way in engine to do so.
Depending on your actor, they could have one weapon and up to 4 items of armor equipped (or more, if you are using a script to do this). Or they could have up to 2 weapons and up to 3 items of armor.


So you would need to check and display, 5 times, if you wanted to show ALL their equipment.


How do you intend to draw the picture on the screen? Is it on a menu screen, or on the map? Is it on ALL maps, or only one/some?


There are so many possibilities that it would take too long, and would be too confusing, for me to show you each one, unless you narrow down the requirements a little more.
 
Last edited by a moderator:

Danny Mezzina

Villager
Member
Joined
Jul 16, 2012
Messages
18
Reaction score
0
First Language
German
Primarily Uses
Aye, you are right, ok let me try "reexplain" :)

As I said I am experimenting right now, I am actually trying to see if I could do a strategy game.

Basically it would work like this:

each actor is a leader and commands four units, these units are "equipped" one in the weapon slot, one shield, one body and one on the helmet slot.

In combat I would use a event system to simulate it, not a real combat system. (I couldn't script to save my life ^^; )

So I want to have the picture of the leader on top of an empty screen, and three pictures below the portrait to show jpegs depicting the units equipped by him.

Not the tiny item icons but 96x96 jpegs.

So I would need to know which units are equipped and then to show that specific pictures on screen.

(enemies would be on the opposite side of the screen and battle effects in the middle, but with these I have no problem, its the party members and actors with which i have the problem.)

Now I figured out how to do that with conditional branches.

I would go: set variable x to party member or actor id

then a whole bunch of conditional branches basically asking, if actor 1 has this equipped show that image.

This works fine in theory, it just gets messy because right now I have a lot of units ^^;

I think I can manage it with common events, but I wish there would be a easier way, or a more elegant way of archieving the same thing.

I hope this makes it a little more clear, but please if not tell me and i will elaborate further :)

edit: I actually also use Yanfly's enhanced shops, so every piece of equipment or troop in this case has already a image attached to it outside of the icon
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,977
Members
137,563
Latest member
cexojow
Top