Thread Tools Display Modes
12-12-17, 09:26 AM   #1
beakflop
A Kobold Labourer
 
beakflop's Avatar
Join Date: Dec 2017
Posts: 1
Need help calling upon a previously stored value

Hi! I am -very- new to toying with addons, so please forgive me if I term something incorrectly.

I've been toying around with TRP3 extended, and have been trying to make a battle system of sorts that uses a global variable system to keep track of things like Health, enemies defeated, etc.. I've been able to learn how to do most of what I've wanted to do by reverse-engineering the items that came pre-packaged with the addon, but I'm a little stumped when it comes to this last thing.

I set up a little system to remember the previous dice roll result via ${last.return} and storing it as "lastroll".. Doing so, I've been able to keep track of my last roll in the main quest box that the addon provides, as seen here:

https://i.imgur.com/xvK3XsY.png

However, when I try and call upon that value in the middle of a workflow to subtract it from "hp" (which is displayed in the first pic), I'm not sure what to type in.

https://i.imgur.com/ACkzREy.png -- I wrote "whatdoiputhere" for the bit I'm confused about. How do I call on the value of "lastroll" in a similar way ${last.return} does for the previous output, so I can subtract the diceroll result from "hp"? I tried ${lastroll} as well as just lastroll, but those didn't work.

I'm unsure of what code/language the addon even uses so I've had a lot of trouble looking it up myself. Everything else works fine, I just don't know what to type there. Any help would be awesome, thanks
  Reply With Quote
12-12-17, 10:54 AM   #2
Ammako
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 256
Does this even involve writing lua or xml in any way?
If not, then this isn't really appropriate for this particular forum section, and in general I don't know how many people here would even know how this works, I'm afraid.
Have you tried asking the devs of the addon? Or, given how big RP is, finding a community who uses this addon and who may be able to help better?
  Reply With Quote
12-13-17, 12:34 PM   #3
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860


${last.return} isn't valid Lua
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
12-13-17, 01:36 PM   #4
jeffy162
A Pyroguard Emberseer
 
jeffy162's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 2,364
ALL addons for WoW are written using Lua as the language. If it doesn't look right it MAY be slightly obfuscated (although, I thought Blizzard had rules against doing that now).
__________________
Ahhhh, the vagueries of the aging mind. Wait.... What was I saying?


Carbonite <----- GitHub main module (Maps ONLY) download link. The other modules are also available on GitHub.
Carbonite-CLASSIC<----- GitHub link to Carbonite Classic. Thanks to ircdirk for this!
  Reply With Quote
12-13-17, 04:41 PM   #5
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
TRP3 has some limited help located on their Curseforge project pages (some videos and links on the right):
https://wow.curseforge.com/projects/...ages/tutorials
And a documentation site that mostly covers the addon/Lua part:
https://totalrp3.info/documentation

After looking through the first link, I believe there's a variable setting option according to the comments, which had this image. You then should be able to call your own variable using ${variablename} in a later step. For example, the variable in the linked image should be able to be accessed using ${positionX}.

With that said, as others pointed out, this is custom coding and not how addons work. Only TRP3 uses stuff like this. If you intend to mess with addons in the future, be sure to forget, or at least not focus on, what you've learned making TRP3 campaign stuff.

Last edited by Kanegasi : 12-13-17 at 04:47 PM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Need help calling upon a previously stored value

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off