Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
  • 0
Tomo2000

[XP] Stupid Scripting Question

Question

Hey guys,

 

I'm having a problem with a crafting script. If you have, say, a gun equip, and you combine it with a different ammo-type (say, from normal to hollow-point), you still have the normal gun in your equip. Is there a way you could either set the new item to be equipped, or just remove the currently equipped item?

 

Thanks in advance.

~Tomo2000.

Share this post


Link to post
Share on other sites

10 answers to this question

Recommended Posts

  • 0
Is there a way you could either set the new item to be equipped, or just remove the currently equipped item?

Yes there is, but I totally don't get your example.

Share this post


Link to post
Share on other sites
  • 0

Well, is there a way you could either;

  • force a weapon to equip itself, or
  • to force the currently-equipped weapon to un-equip itself?

Share this post


Link to post
Share on other sites
  • 0

Well, is there a way you could either;

  • force a weapon to equip itself, or
  • to force the currently-equipped weapon to un-equip itself?

There are multiple ways to do either, the reason why I was referring to your example is that it all depends in what context you're trying to do so. FIrst, it's unclear whether you're trying to script it yourself or just using some third party script. Then why do you talk about "forcing" a weapon to equip/unequip? It suggests that you're trying to do so in a context where the weapon couldn't normally be equipped/unequipped. Basically, are you simply looking for the name of the method which can change an actor's equipment, or trying to figure out a solution for a specific situation? Please be specific with your requests if you hope to get the proper answers.

Share this post


Link to post
Share on other sites
  • 0

Are you simply looking for the name of the method which can change an actor's equipment?

 

Yeah, that one. Sorry about not being too specific, long night last night... xD And, no, it isn't a third-party script, it's my own.

Share this post


Link to post
Share on other sites
  • 0

$game_actors[ACTOR_ID].equip(EQUIP_TYPE, ID)

 

the ACTOR_ID starts at 0 i think, if not it starts at 1, for EQUIP_TYPE here are the cases:

 

0=weapon

1=shield

2=head

3=body

4=accessory

 

then the ID is the id of the item in the database, 0 unequips it, hope this helps :)

Share this post


Link to post
Share on other sites
  • 0

$game_actors[ACTOR_ID].equip(EQUIP_TYPE, ID)

 

the ACTOR_ID starts at 0 i think, if not it starts at 1, for EQUIP_TYPE here are the cases:

 

0=weapon

1=shield

2=head

3=body

4=accessory

 

then the ID is the id of the item in the database, 0 unequips it, hope this helps :)

 

"Undefined method 'equip' "

Share this post


Link to post
Share on other sites
  • 0

I think that, if it were the problem with the actor integer, it would have said so. It isn't recognizing the 'equip' part of it.

Share this post


Link to post
Share on other sites
  • 0

hmmm strange, i coppied and pasted the script call i posted and changed the integers as necessary and all was well, the only thing that would cause that problem is if the actor does not exist for the one your trying to change it for, which it should if it exists in the database, as by default the engine creates all actors when a new game is created, here is 2 things that could cause any problems:

  • you are using an old save where the actor did not exist in the database when it was created
  • a custom script overwrites the way actors are created

 

try it as a new game if you have been using old save data, if thats not the case do you have any scripts that could mess with the actors in any way, a demo would help if the problem persits, if you feel uncomfortable about posting it unencrypted just send me a copy with only the essentials like scripts and a test map setup to test it

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...