Menu
 

Modding Rundown: PY Scripts

Started by Teancum, April 19, 2007, 06:04PM

Previous topic - Next topic
October 29, 2021, 11:57AM #60 Last Edit: October 29, 2021, 12:11PM by BaconWizard17
A new one I found in XML2's exe:

X = isCharacterUnlocked("name")

Use to tell if a character has been unlocked or not. == 1 if they are, == 0 if they aren't. Also returns 0 if the character is not on the roster at all.

I feel like I am missing something.
been working on a script to give statboost using
permanentStatBoost('name','stat')

Based on intial post it indicates that leaving name empty it will give boost to all heros as shown in below quote,

QuotepermanentStatBoost('name','stat')
Raises a hero stat (skill, body, focus...) For Example: permanentStatBoost('_HERO1_','skill') Gives whoever is in the first character slot 1 new skill point.  If name is empty, applies to all

But does not seem to work when leaving name as an empty string '' , nor null, None, omiting the variable and just passing in stat, tried ' ' single space string, and still no boost to stats to characters
Starting to think its not a thing in MUA, but just wanted to ask about this to make sure I am not overlooking something or misunderstanding something.

Thanks for any clarity anyone can provide in relation to this,  :warbird: Stay Awesome

Quote from: CCali on December 03, 2021, 09:12PM
I feel like I am missing something.
been working on a script to give statboost using
permanentStatBoost('name','stat')

Based on intial post it indicates that leaving name empty it will give boost to all heros as shown in below quote,

But does not seem to work when leaving name as an empty string '' , nor null, None, omiting the variable and just passing in stat, tried ' ' single space string, and still no boost to stats to characters
Starting to think its not a thing in MUA, but just wanted to ask about this to make sure I am not overlooking something or misunderstanding something.

Thanks for any clarity anyone can provide in relation to this,  :warbird: Stay Awesome

Have you tried using _HERO1_? That will apply it to the first hero on your team. If that doesn't work, then the 'stat' portion may be incorrect. Which script are you putting this in?

Sorry, missed reply and question earlier,

Quote from: BaconWizard17 on December 05, 2021, 10:23AM
Have you tried using _HERO1_? That will apply it to the first hero on your team. If that doesn't work, then the 'stat' portion may be incorrect. Which script are you putting this in?

If I use
permanentStatBoost('_HERO1_','skill')
it works as as expected based on the description given, gives 1 skill point to first hero,

but when reading back to op, it says
Raises a hero stat (skill, body, focus...) For Example: permanentStatBoost('_HERO1_','skill') Gives whoever is in the first character slot 1 new skill point.  If name is empty, applies to all

This is the part I was trying to get to work, if name is empty applies to all.

it does not seem this part is true for MUA, seems like you have to specify a HERO, or the owner or activator to get the boost.
but I could be missing something, or this statement is only true in maybe XML1 and/or 2 but not MUA.

in mua if I tried
permanentStatBoost('','skill')   leaving name empty string as the op suggest, I expected either team to get it or all my unlocked heroes. but neither happened
nor did it work with focus or the other stats
also tried permanentStatBoost('skill') and permanentStatBoost(null,'skill') and permanentStatBoost(None,'skill')
but no version of leave name empty seemed to work, also tried with focus stat in each case to see if was issue with skill boost part or something.

So I was intially trying to figured out if I missed something. I did find away to get same effect I wanted for the mod by giving all characters 3000 xp at beginning of a new game, since to fit in all the talents in the herostats I removed the auto give of everyone's first power (tey were taking up 50 of the entries and I wanted to give several heroes some base talents). This gets the same effect of +1 skill point. But some characters auto spend gives the point to boost instead of first power.

Even though I found a work around would be nice to know for certain, if that line of leave name empty to apply to all works in mua and if so what was I misunderstanding. Or leaving name empty does not work in mua, thats fine. could even be a mistake in the original post. Only been doing this stuff for like 2 weeks now, so there is much to learn.

Stay Awesome :warbird:

It may not actually work for the whole team then, and you'll have to do one line for each character, i.e.
permanentStatBoost('_HERO1_','skill')
permanentStatBoost('_HERO2_','skill')
permanentStatBoost('_HERO3_','skill')
permanentStatBoost('_HERO4_','skill')

That works too, and looking at using it with something else I am doing.

But I was so focused on it because I wanted +1 skill points for all playable heroes,
and description sounded like my ticket to what I wanted but in end for that just made all
playable heroes start at level 2. It works but feels a little hacky and not exactly what I
wanted. So was seeing if anyone had more info on it.
But looks like something I will just have to live without and do things the way I found,
even if not perfect

Stay Awesome :warbird: