Jump to content
  • 0

How to change class when equips an specified weapon?


staz

Question

There is a way to trigger events when an specified weapon item is equipped? ex: uses a gun then trigger event change class to be a shooter, same to swordsman etc... i see some trigger type that happen when equips are changed, but its general and i could not think an easy way to test if changed equip was a gun or a sword or something else to change class correcty, if not anyone with knowledge of code can drawme an easy way to do it by coding myself? path, archive, some specifc code line or even an pseudo algoritm to do this goal, TY

 

Edit: i finally did it by using the event condition creating a condition list for each weapon i want to trigger as "equipped item is" and creating 3 different events(i for each class and with only one command "set class to X") the trigger is equips are changed, this wy i need to add every new item i add in those condition list to make it change to right class when equipped, i still thinking about a more efficient way to do same thing then you still are welcome to sugest different ways, ty again! i hope this help someone to achieve the same thing i was looking for. 

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

I reckon it'd be more efficient long term to add an extra field to each item for a ''type'', ie. Gun, Lance, Sword, etc. and then add a new conditional value that checks against that field.

 

It would require some source work, but would still allow you to make use of the event system as a whole.

Link to comment
Share on other sites

  • 0
1 hour ago, Weylon Santana said:

The intersect can trigger common events when equip/unequip item, using that and some checks just switch classes with the switch class command.

 

From my understanding he's already done that, but keeping lists of every weapon in the game for a conditional sounds quite tedious to me in the long run.

Link to comment
Share on other sites

  • 0
1 hour ago, Cheshire said:

 

From my understanding he's already done that, but keeping lists of every weapon in the game for a conditional sounds quite tedious to me in the long run.

yes, i will keep the way it is for now because i have alot to push in the project, but i will use this as exercise to start to code as soon possible, ty! and Weylon, valeu tbm man, tmj! precisando tamo ai.

Link to comment
Share on other sites

×
×
  • Create New...