RPTools.net

Discussion and Support

Skip to content

It is currently Tue Dec 12, 2017 5:18 am 






Reply to topic  [ 5 posts ] 

Previous topic | Next topic 

  Print view

Author Message
 Offline
Kobold
 
Joined: Wed Jan 11, 2017 6:22 pm
Posts: 5
 Post subject: Error executing custom function
PostPosted: Sun Jan 15, 2017 10:01 am 
The function be works fine if I directly click on it

Code:
[Bonus="Training"]<br>
[Value="3"]<br>
[work="Base=13; Arcane=3,-4; Divine=2,4; Training=2; Racial=2; infernal=-1,-2"]<br>

[h:result = getstrprop(work,bonus,"None")]
[h,if(result=="None"):result=value;result=listappend(result,value)]

[h:work=setstrprop(work,bonus,result)]

[r:work]


I put the following in onCampaignLoad

Code:
[defineFunction("Bonus.Add", "AddBonus@Lib:Parse")]


Then i make a macro with the following line (only)

Code:
[bonus.add()]


And get the following error.

Quote:
java.lang.NullPointerException error executing expression bonus.add().


I've defined a couple of other functions which are working flawlessly And The function exists (would give a function undefined error otherwise)

_________________
It's better to be a Morloc then an Eloi


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7964
Location: Bay Area
 Post subject: Re: Error executing custom function
PostPosted: Sun Jan 15, 2017 11:13 am 
Probably the apply to selected token isn't checked and/or the macro needs to uncheck Allow Players to edit.

_________________
Downloads:


Top
 Profile  
 
 Offline
Kobold
 
Joined: Wed Jan 11, 2017 6:22 pm
Posts: 5
 Post subject: Re: Error executing custom function
PostPosted: Sun Jan 15, 2017 12:34 pm 
Check, not writable by players and have tried with apply to selected tokens both on and off with no difference.

My understanding of Apply to Selected Tokens is that it only matters if the macro is actually affecting a token. Am I incorrect on that?

_________________
It's better to be a Morloc then an Eloi


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7964
Location: Bay Area
 Post subject: Re: Error executing custom function
PostPosted: Sun Jan 15, 2017 1:19 pm 
You're right, it's just something I just always suggest checking first. The UDFs may actually be case sensitive, so I would try using the proper case in your function call. It's a good idea to always use the proper case for everything even if the parser may ignore it.

_________________
Downloads:


Top
 Profile  
 
 Offline
Kobold
 
Joined: Wed Jan 11, 2017 6:22 pm
Posts: 5
 Post subject: Re: Error executing custom function
PostPosted: Sun Jan 15, 2017 1:52 pm 
That actually worked :D ... I should have thought of that. I actually went to school for programming but haven't done much for 15+ years. Am a little rusty.

_________________
It's better to be a Morloc then an Eloi


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 5 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 1 guest





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman