This is probably going to be very simple, so bear with me lol.
In my properties for a D&D 3.5 like campaign, I have Weapon1, WeaponToHIt1, WeaponDamage1. I have this repeated 2 more times with a number at the end (Weapon2, etr). I wanted to make one macro for ‘Equipping Weapons’ that allows you to pick which of the three you’re changing. I figured it would be as simple as asking for a variable for a number 1-3, then doing something like…
[Weapon+”WeaponNumber” = whatever]
[WeaponToHit+”WeaponNumber” = whatever1]
[WeaponDamage+”WeaponNumber” = whatever2]
However, this isn’t working >< Can someone tell me what I’m doing wrong and why?
Calling Properties with a Variable?
Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice
-
- Kobold
- Posts: 7
- Joined: Sat Mar 29, 2014 11:51 am
Re: Calling Properties with a Variable?
You're close.
Code: Select all
[H: whatever = eval("Weapon"+WeaponNumber)]
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
-
- Kobold
- Posts: 7
- Joined: Sat Mar 29, 2014 11:51 am
Re: Calling Properties with a Variable?
Actually, posting this and continuing my search through forum helped me find what I needed >< Like two minutes after I posted, I found a thread on page 6 or 7 talking about SetProperties. Though I'll have to look what Eval does because I've seen it mentioned a lot lol.
- Bone White
- Great Wyrm
- Posts: 1124
- Joined: Tue Aug 23, 2011 11:41 am
- Location: Cornwall, UK
Re: Calling Properties with a Variable?
For reference, the opposite of eval is Wiki: set().