Jump to content

Script help (string to name?)


Recommended Posts

Hey, I'm trying to make use of the function PauseEffects from effectManager.ws but I can't get the sourceName parameter to get accepted because wherever I get sourceName from is always a string. When I try to implement the effects.sourceName code it says "cannot convert from string to name". I found a NameToString function, but I can't find a StringToName so that the PauseEffects function will accept my sourceName. Any help would be appreciated.

Link to comment
Share on other sites

If you know the names of the effects, you could do something like this-

 

function effectStringToName(s : string) : name
{
switch (s)
{
case "effect1": return 'effect1'; break;
case "effect2": return 'effect2'; break;
}
return '';
}
Edited by eNoodles
Link to comment
Share on other sites

 

If you know the names of the effects, you could do something like this-

 

function effectStringToName(s : string) : name
{
switch (s)
{
case "effect1": return 'effect1'; break;
case "effect2": return 'effect2'; break;
}
return '';
}

 

 

Thanks I'll give that a try. Do you happen to know if the sourceName parameter means the ability's name, the player character's name, or something else? I found an already made function called EffectTypeToName but that didn't end up working to use as effects.EffectTypeToName() for the sourceName parameter.

 

What I'm currently trying to do is use the PauseEffect function inside of the Friendly Meditation mod to keep buffs' durations from counting down while meditating, if that helps give you any clearer idea of how to help.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...