UDF

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Post Reply
Sydious
Giant
Posts: 155
Joined: Sun Aug 21, 2011 2:27 am

UDF

Post by Sydious »

Do UDF need to be called on macros the reside on the Lib:Token or can another token's macro call a UDF ?

Like a player's token has a macro that that calls the UDF. Or is that not how it works?

User avatar
aliasmask
Deity
Posts: 8609
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: UDF

Post by aliasmask »

UDF (User Defined Function), so it can be used anywhere a function can be used. Typically, I put all my UDF on a lib token and have other macros call those UDFs. It keeps the code hidden from the players and keeps the control in the GMs hands. But yes, defined functions can be called by anyone, anywhere as long as it's defined for that client. It's possible to define it for some people and not others, but that's not the norm.

Sydious
Giant
Posts: 155
Joined: Sun Aug 21, 2011 2:27 am

Re: UDF

Post by Sydious »

aliasmask wrote:But yes, defined functions can be called by anyone, anywhere as long as it's defined for that client.


so defined for that client?

Does that mean if I make a UDF on a onCampaignLoad macro, and run it, but the players (test clients) are still connected, they need to reconnect to have them take hold?

I'm asking becuase I made my first UDF and created a test macro to experiment how they work. Once I got it working, i added it to an exsisting macro. When the player runs it I get an error stating it doesn't exsist on that client.
(I have 1 open running the server, and 3 more open connected to the server via LAN.)

User avatar
aliasmask
Deity
Posts: 8609
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: UDF

Post by aliasmask »

If you have the UDF definitions in the onCampaignLoad, make sure it exists before ppl connect, so the onCampaignLoad is run for them when they connect. Make sure you know the rules for lib tokens too. No owners, visible to players and macros can not be editable by players.

User avatar
wolph42
Deity
Posts: 9790
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: UDF

Post by wolph42 »

Sydious wrote:Does that mean if I make a UDF on a onCampaignLoad macro, and run it, but the players (test clients) are still connected, they need to reconnect to have them take hold?

yes.

Post Reply

Return to “Macros”