News: Go to the front page portal to create a Torchmodders account | Visit the wiki!
July 20, 2019, 03:37:43 AM
collapse

*
Information

Please contribute to our


Sign up for a forum account at the Front Page. | Remember to Tag your posts.
Having problems logging in to the forums? Go the front page, log out and back in again.

Author Topic: Triggerable Weapons  (Read 591 times)

Offline Phanjam

  • Operator
  • Legendary
  • *
  • Posts: 2691
  • 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: 2691
  • 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: 2691
  • 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: 2691
  • 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: 2691
  • 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 ;)



 

* Quick Search


* Member Information

 
 
Welcome, Guest. Please login or register.
Did you miss your activation email?

* Mod Boards Activity

* Who's Online

  • Dot Guests: 5
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Calendar

July 2019
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 [20]
21 22 23 24 25 26 27
28 29 30 31

No calendar events were found.

* Recent Topics

Custom Charge Bar... by Phanjam
[July 19, 2019, 07:22:31 AM]


Variant Classes Mod Information by Viz
[July 19, 2019, 04:31:55 AM]


Hacker Class Mod by steffire3
[July 15, 2019, 07:14:24 PM]


Heya folks! by steffire3
[July 15, 2019, 07:07:58 PM]


Tenebris class, I need to know... by Phanjam
[July 14, 2019, 03:28:27 AM]


Would like to complete the Wiki Lore by steffire3
[July 13, 2019, 03:35:54 AM]


Skills Expansion: Rebalanced Native Skills by lemon 'nade
[July 08, 2019, 03:33:01 PM]


Hosting for 2019 by Kva3imoda
[July 07, 2019, 11:01:48 AM]


Need Help: a problem in GUTS by Sch123
[July 03, 2019, 08:27:13 AM]


Poll: Your 4 favorite kinds of Class Combat Styles? by Phanjam
[July 03, 2019, 05:57:16 AM]


[Stats], [Effects] & [Charges] by Rhythmier
[July 02, 2019, 07:07:35 AM]


Lightbringer Mod (Paladin) by Rhythmier
[July 02, 2019, 07:05:39 AM]


Big Quality Mod List by steffire3
[June 29, 2019, 08:18:03 PM]


Combined Stat Totals not listed by steffire3
[June 29, 2019, 08:06:12 PM]


Summoner Class Mod List by steffire3
[June 29, 2019, 07:20:15 PM]

* Popular Topics