WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Need help calling upon a previously stored value (https://www.wowinterface.com/forums/showthread.php?t=55913)

beakflop 12-12-17 09:26 AM

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 :)

Ammako 12-12-17 10:54 AM

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?

Seerah 12-13-17 12:34 PM

:confused:

${last.return} isn't valid Lua

jeffy162 12-13-17 01:36 PM

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).

Kanegasi 12-13-17 04:41 PM

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.


All times are GMT -6. The time now is 10:31 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI