collapse

* Important


The forum and all threads have been locked, but are still available for browsing.  There is more information about this here.


The

Is still open for article contributions.

Author Topic: Triggerable Weapons  (Read 2412 times)

Offline Phanjam

  • Operator
  • Legendary
  • *
  • Posts: 2,751
  • Country: ph
    • status ready
    • View Profile
  • Mood: mood angel
Triggerable Weapons
« on: April 19, 2019, 07:17:40 am »
Hi! I'm going to post about this exercise to make "triggerable weapons". The idea was to make weapons which behave how the "relic weapons" in the upcoming Torchlight Frontiers game work (at least how i understood it from their descriptions).

So my take-off was from TL2's "augmentable weapons".  These use an affix which (a) attaches a triggerable to increment a stat whenever the weapon does something this first triggerable is set to look for (like "kill x monsters"), and (b) attaches a second triggerable which activates some special affix when the watched stat reaches a value this second triggerable is looking for.

In the vanilla augmentable weapons, the special affix also does a REMOVE TRIGGERABLE on the unit, wiping away both of the triggerables mentioned above. My idea was to leave those triggerables on the unit and just do a SET STAT to bring the watched stat back to a value of 0 or 1, thereby allowing the triggerables (which are still on the unit) to do their thing all over again ;) .

So as usual I am still having trouble making this work. And since I can't spend too many hours bird-dogging this, i wanted to post so people smarter than me might get interested to try and figure it out.



Offline Phanjam

  • Operator
  • Legendary
  • *
  • Posts: 2,751
  • Country: ph
    • status ready
    • View Profile
  • Mood: mood angel
Re: Triggerable Weapons
« Reply #1 on: April 19, 2019, 07:17:53 am »
Here is the unit file. It's a straight copy of the GREATSWORD_N01.DAT file in the GUTS media folder, just renamed / re-GUID'd and adding a custom affix for the triggerables.

TRIGGERABLE UNIT
Code: [Select]
[UNIT]
<STRING>BASEFILE:media\units\items\2HSword\base_2hsword.dat
<STRING>UNIT_GUID:8400082774156798390
<INTEGER>DAMAGE_PHYSICAL:1000
<TRANSLATE>DISPLAYNAME:Reliquary Broadsword
<INTEGER>LEVEL:2
<STRING>MESHFILE:greatsword01
<STRING>NAME:reliquary_greatsword_n01
<INTEGER>RARITY:0
<STRING>RESOURCEDIRECTORY:media/models/weapons/_Greatswords
<INTEGER>SPEED:90
<INTEGER>SPEED_DMG_MOD:90
<STRING>ICON:icon_weapon_greatsword01
<INTEGER>DEFENSE_REQUIRED:0
<INTEGER>DEXTERITY_REQUIRED:0
<INTEGER>MAGIC_REQUIRED:0
<INTEGER>STRENGTH_REQUIRED:40
<INTEGER>MINLEVEL:1
[AFFIXES]
<STRING>AFFIX:CRIT_EVERY_10_KILLS
[/AFFIXES]
[/UNIT]

So the affix which starts it all of is CRIT_EVERY_10_KILLS, which looks like this...

CRIT_EVERY_10_KILLS AFFIX
Code: [Select]
[AFFIX]
<STRING>NAME:CRIT_EVERY_10_KILLS
<TRANSLATE>PREFIX:Reliquary [ITEM]
<INTEGER>RANK:1
<INTEGER>MIN_SPAWN_RANGE:11
<INTEGER>MAX_SPAWN_RANGE:999
<FLOAT>DURATION:0
<INTEGER>WEIGHT:5
<INTEGER>SLOTS_OCCUPY:1
[UNITTYPES]
<STRING>UNITTYPE:WEAPON
[/UNITTYPES]
[NOT_UNITTYPES]
<STRING>UNITTYPE:MAGIC
[/NOT_UNITTYPES]
[EFFECT]
<STRING>NAME:CRIT_EVERY_10_KILLS
<STRING>ACTIVATION:DYNAMIC
<STRING>DURATION:INSTANT
<STRING>TYPE:ADD TRIGGERABLE
<FLOAT>CHANCE:100
[/EFFECT]
[EFFECT]
<STRING>NAME:CRIT_EVERY_10_KILLS_COUNT
<STRING>ACTIVATION:DYNAMIC
<STRING>DURATION:INSTANT
<STRING>TYPE:ADD TRIGGERABLE
<FLOAT>CHANCE:100
[/EFFECT]
[/AFFIX]

the first triggerable it adds is also named CRIT_EVERY_10_KILLS.  This is the triggerable which gives the special affix when the triggerable condition is met - in this case, "kill 10 monsters".

CRIT_EVERY_10_KILLS, FIRST TRIGGERABLE
Code: [Select]
[TRIGGERABLEACTION]
<STRING>NAME:CRIT_EVERY_10_KILLS
<TRANSLATE>DESCRIPTION:|cFFEAAA15Reliquary Weapon:\nKill 10 enemies to activate
//I just removed this part (<stat:killcount_any_25_crit>/25 killed)
<STRING>GAMEEVENTTYPE:STAT
<STRING>EVENTCREATOR:SELF
<STRING>SUBTYPE:ADDSTAT
<INTEGER>LEVEL:1
<FLOAT>FLOATCONDITION:10
<INTEGER>COOLDOWN:0
<BOOL>MESSAGEONTRIGGER:true
[AFFIXES]
<STRING>AFFIX:10_KILL_CRIT
[STATWATCHER]
<STRING>STAT:KILLCOUNT_CRIT_EVERY_10_KILLS
<STRING>PRIMARY_TARGET_TYPE:SELF
<STRING>SECONDARY_TARGET_TYPE:VALUE
<STRING>WATCH_TYPE:GREATER THAN
<FLOAT>SECONDARY_VALUE:9
[/STATWATCHER]
[/AFFIXES]
//I also removed the following lines so the triggerables stay on the unit
//[TRIGGERABLESREMOVE]
// <STRING>TRIGGERABLE:CRIT_EVERY_10_KILLS
// <STRING>TRIGGERABLE:CRIT_EVERY_10_KILLS_COUNT
//[/TRIGGERABLESREMOVE]
[/TRIGGERABLEACTION]

So it's looking for the stat KILLCOUNT_CRIT_EVERY_10_KILLS to reach 10 and then it will award the special affix 10_KILL_CRIT.

The second triggerable given by the CRIT_EVERY_10_KILLS affix is CRIT_EVERY_10_KILLS_COUNT...

CRIT_EVERY_10_KILLS_COUNT, SECOND TRIGGERABLE
Code: [Select]
[AFFIX]
<STRING>NAME:ADD_CRIT_EVERY_10_KILLS_COUNT
<INTEGER>RANK:0
<INTEGER>MIN_SPAWN_RANGE:0
<INTEGER>MAX_SPAWN_RANGE:999
<FLOAT>DURATION:0
<INTEGER>WEIGHT:0
<INTEGER>SLOTS_OCCUPY:0
[EFFECT]
<STRING>NAME:KILLCOUNT_CRIT_EVERY_10_KILLS
<STRING>ACTIVATION:DYNAMIC
<STRING>DURATION:INSTANT
<STRING>TYPE:ADD STAT
<FLOAT>MIN:1
<FLOAT>MAX:1
<FLOAT>CHANCE:100
[/EFFECT]
[/AFFIX]

So this triggerable is looking for instances that you kill a monster using this weapon, and when it sees that it will increment the stat KILLCOUNT_CRIT_EVERY_10_KILLS by 1 (same stat the first triggerable is watching to reach 10).

For reference here is the code for the stat KILLCOUNT_CRIT_EVERY_10_KILLS...

KILLCOUNT_CRIT_EVERY_10_KILLS STAT
Code: [Select]
[STAT]
<STRING>NAME:KILLCOUNT_CRIT_EVERY_10_KILLS
<INTEGER64>UNIQUE_GUID:-1773635467609341913
<TRANSLATE>DISPLAYNAME:Monsters Slain
<STRING>TYPE:TYPE_INT
<FLOAT>MAXVALUE:10000
<BOOL>SAVES:true
[/STAT]

So assuming the first triggerables is working, when you kill 10 monsters with the weapon the stat should be at 10, which then activates the second triggerable to give you the special affix.

Here is the code for the special affix 10_KILL_CRIT SPECIAL...

10_KILL_CRIT SPECIAL AFFIX
Code: [Select]
[AFFIX]
<STRING>NAME:10_KILL_CRIT
<INTEGER>RANK:1
<INTEGER>MIN_SPAWN_RANGE:0
<INTEGER>MAX_SPAWN_RANGE:999
<FLOAT>DURATION:30
<INTEGER>WEIGHT:0
<INTEGER>SLOTS_OCCUPY:0
[UNITTYPES]
<STRING>UNITTYPE:WEAPON
[/UNITTYPES]
[NOT_UNITTYPES]
<STRING>UNITTYPE:WEAPON
[/NOT_UNITTYPES]
[EFFECT]
<STRING>NAME:RELIQUARY CRITICAL CHANCE
<STRING>ACTIVATION:PASSIVE
<STRING>DURATION:0
<STRING>TYPE:CRITICAL CHANCE
<STRING>UNITTHEME:BERSERKERRAGE
<FLOAT>MIN:100
<FLOAT>MAX:100
[/EFFECT]
[EFFECT]
<STRING>NAME:KILLCOUNT_CRIT_EVERY_10_KILLS
<STRING>ACTIVATION:PASSIVE
<STRING>DURATION:INSTANT
<STRING>TYPE:SET STAT
<FLOAT>MIN:0
<FLOAT>MAX:0
<FLOAT>CHANCE:100
[/EFFECT]
[/AFFIX]

So the special affix is meant to let you crit 100% of the time for 30 seconds ( <FLOAT>DURATION:30 ).  I included the unit theme BERSERKERRAGE just to give me some visual indication that the affix had been awarded.

Lastly, it has the SET STAT effect to bring the stat KILLCOUNT_CRIT_EVERY_10_KILLS back to 0, so the cycle can begin again.
« Last Edit: April 19, 2019, 07:42:56 am by Phanjam »



Offline Phanjam

  • Operator
  • Legendary
  • *
  • Posts: 2,751
  • Country: ph
    • status ready
    • View Profile
  • Mood: mood angel
Re: Triggerable Weapons
« Reply #2 on: April 19, 2019, 07:32:04 am »
Okay so troubleshooting...

The 2 main triggerables seem to get applied just fine (they show in the GUTS combat log when i spawn the weapon), but when i kill 10 onsters nothing seems to happen :P

What i was troubleshooting when i had to stop for other RL things were...

1. the "add 1" triggerable isnt working, so the stat isnt incrementing
2. the stat is incrementing but the "grant special affix" triggerable isnt working
3. the triggerable is awarding the special affix, but its improperly coded so it looks like its not being awarded

So thus it will stay, until i am able to get back to it :P

But if anyone wants to take a crack at it, pls be my guest!  The MEDIA folder in its current state is attached below...
« Last Edit: April 19, 2019, 07:40:28 am by Phanjam »



Offline Phanjam

  • Operator
  • Legendary
  • *
  • Posts: 2,751
  • Country: ph
    • status ready
    • View Profile
  • Mood: mood angel
Re: Triggerable Weapons
« Reply #3 on: April 29, 2019, 11:15:57 am »
Okay an update on this experiment, by way of an infographic...



So it's kinda working atm, but looks like i need to refine how i code-up the special affix that's meant to be applied.

Woot! Ever forward! :D



Offline Phanjam

  • Operator
  • Legendary
  • *
  • Posts: 2,751
  • Country: ph
    • status ready
    • View Profile
  • Mood: mood angel
Re: Triggerable Weapons
« Reply #4 on: June 04, 2019, 12:25:05 pm »
Hey all! For now a quick post to say that "trigerrable weapons" are now a real thing, thanks heavily to Twinkletoes!

His method uses all skills - had to move away from trigerrables because it had issues with who "owns" what effect or trigerrable :P It works like a charm! Will post code samples in a future post.

Next i will try see if i can get the trigerrables method to work on player units ;)



 

Our host and sponsor

* Quick Search


* Mod Boards Activity

* Popular Topics