Marvel Mods

XML and MUA - Common Items => Knowledge Base - (not for questions) => Topic started by: Teancum on April 19, 2007, 06:04PM

Title: Modding Rundown: PY Scripts
Post by: Teancum on April 19, 2007, 06:04PM
PY Scripts are basic scripts that can be opened in notepad.  Here's a basic rundown of functions that can be used.

============================================================================================
beATeamPlayer("character", "TRUE" )

Causes an NPC to fight alongside your team.

===========================================================================================
strcatstr("string1", "string2")

Combines two strings.  The following code would create "Hawkeye Rocks" as a string if Hawkeye were the first playable character of the four active characters.

heroName = GetHeroName('_HERO1_')
strcatstr(heroName, " Rocks")

===========================================================================================
unlockCharacter('name','costume') **Note, in XML1, the verb is charUnlock()

We'll use XML2 Deadpool as an example.

Here's how it works.  If you want to unlock a character for playing, you would enter unlockCharacter('deadpool', ' ').  This will unlock him and his default costume.

If you want to unlock a specific costume (XML2 only) for a character, you specify it.  You can figure out what they are by looking in the herostat.  Look for skin_[name].  The [name] part is what we need.  So in this case we can use unlockCharacter('deadpool','astonishing').  You can also unlock specific costume sets only by using unlockCharacter('','costume').  So for Age Of Apocalypse costumes it would be unlockCharacter('name','aoa')

This also works on characters you haven't unlocked yet.  They will stay locked until you unlock them, but these skins will be unlocked when you unlock the character.  And all you'd need to do is stick this in any script that runs before the first extraction point.  Technically you can put it anywhere, but it makes sense to put it before the first point so all skins are unlocked the first time you can change teams.

NOTE: We haven't figured out how to unlock costumes with this command in MUA yet

===========================================================================================
loadMapStartGame()

Loads the map defined as the start of the story

===========================================================================================
setSkin("name", "igb number")

Sets a character to have a specific model.  Looking in the IGB list we know that Luke Cage is 157.  His first skin is 01, so we'd use:
setSkin("LukeCage", "15701")

===========================================================================================
setInvulnerable("name", "TRUE/FALSE" )

Pretty self explanatory.  Sets invulnerability for a character on or off.

Example: setInvulnerable("LukeCage", "FALSE" )

===========================================================================================
display ( "TEXT" )

Displays text on the screen.  Does not work

===========================================================================================
Definition of specific static values

"_HERO1_" --First hero slot
"_HERO2_" --Second hero slot
"_HERO3_" --Third hero slot
"_HERO4_" --Fourth hero slot
"_OWNER_" --Performs verb on whoever called it
"_ACTIVATOR_" --Similar to _OWNER_, but used when you activate something.  (A good example is picking up a focus upgrade)
"_ACTIVE_HERO_" -- Name explains itself, it's the character the player currently uses.

===========================================================================================
loadZone("map", "spawn point in map" )

Loads a specific map zone. If the second parameter is specified, party will spawn at that spawn area. An example of this is in the X-Mansion in XML1. If the player uses the secret elevator in the classroom, the script can specify to spawn in the corresponding section on the 2nd floor or subbasement.

===========================================================================================
killEntity("name")

Kills a specific entity

===========================================================================================
setDangerRoomSuccess( )

Self explanatory.  However in MUA this applies to the Simulator.  The simulator is the Danger Room, just with a different name in-game.

===========================================================================================
cameraReset( )

Resets the camera (after a cutscene presumably)

===========================================================================================
awardReputation("name", integer [number of points] )

Awards reputation to specified character.  If name is empty, applies to all

===========================================================================================
setRecallActive("TRUE/FALSE")

Turn the ability to use the portal on/off

===========================================================================================
triviaMenu( )

Loads the trivia menu

===========================================================================================
reviewMenu( )

Loads the review menu

===========================================================================================
setScale("name", float )

Sets the scale of a character, model or effect to whatever value float is.  (Float values can have decimals for those who don't know)

===========================================================================================
setNoCollide("name", "TRUE/FALSE" )

Sets whether you collide with something

===========================================================================================
awardXPToPlayable(integer)

Awards XP to all playable characters (untested on NPCs with playable=true added)

===========================================================================================
allowConvIfName("_ACTIVATOR_", "name" )

Allows special conversations to be used if the activating charcter = name

===========================================================================================
awardAchievement()

Awards an achievement.  Only used on Xbox 360's Live! system

===========================================================================================
allowConversation("TRUE/FALSE")

Sets whether a conversation is allowed

===========================================================================================
setInvisible("name", "TRUE/FALSE")

Sets whether an entity is invisible

===========================================================================================
setHealth("name", integer)

Self explanitory -- setEnergy("name", integer) works the same

===========================================================================================
setAllAiActive("TRUE/FALSE") & setAiActive("name", "TRUE/FALSE")

Turns AI on/off

===========================================================================================
getConversationActive( )

Checks to see if a conversation is running.  Returns 1 for yes, 0 for no

===========================================================================================
lockCharacter(name, "SKIN" )

Locks a specific character

===========================================================================================
setUnderWater(0/1)

Sets whether we are underwater are not.  1 for yes, 0 for no.  If yes, characters behave like they're underwater.  By default you are not underwater.

===========================================================================================
setDangerRoomFailed()

Sets failure for the Simulator/Danger Room

===========================================================================================
loadMapKeepTeam("map")

Loads a map, but does not allow you to change your team

===========================================================================================
loadMapAddTeam(map)

Loads map, but allows you to change your team

===========================================================================================
loadDangerRoomCourse(map) (XML2) & loadSimulatorComicMission() (MUA)

Loads a Danger Room / Simulator map

===========================================================================================
addSimulatorScore(integer)

Adds a score to the sim

===========================================================================================
randomInt(num1, num2)

Returns a random integer between (and including) the values of num1 and num2.  For example, randomInt(1, 5) will return 1,2,3,4 or 5.

===========================================================================================
GetHealth('name')

Get's a character's current health

===========================================================================================
GetHealthMax('name')

Get's a character's max health allowed

===========================================================================================
SetHealth('name')

Set's a character's current health

===========================================================================================
SetHealthMax('name')

Set's a character's max health allowed

===========================================================================================
heroNoTarget("TRUE/FALSE")

Should the hero target someone?

===========================================================================================

setFollowingHero("character", "TRUE/FALSE" )

Sets a character to follow the player.  A good example is Dr Strange in Mandarin's palace (before you unlock him)

===========================================================================================

spawnEffect("[entity]", "[effect]", " [x/y/z] ", " [p/y/r] " )

Spawns an effect on an entity.  Example: spawnEffect("cyclops_scripted", "powers/mystique_morph", " 0.000 0.000 0.000 ", " 0.000 0.000 0.000 " )
Title: Modding Rundown: PY Scripts
Post by: Teancum on May 15, 2007, 03:03PM
More verbs
===========================================================================================
alive("[entity]")

Checks to see if someone is alive.  Example: alive("spiderman") would see if Spidey's alive

===========================================================================================
cameraShake(4.000, 3.000 )

Vibrates the screen.  The two numbers represent how big and long the vibration is.

===========================================================================================
vibrate("ENTITY", "RUMBLE", 0.200, 2.200 )

Vibrates the screen controller (if enabled)

===========================================================================================
gameover("[something from strings.engb]")

Brings up the Game Over menu, with text that says why from strings.engb.  For instance: GAME OVER - Innocents were killed

===========================================================================================

lockControls(float)

Locks the controls for a specified amount of time.  Example: lockControls(0.100 ) locks the controls for 1/10 of a second

===========================================================================================
dropWeapon("[entity]", "TRUE/FALSE" )

Makes a character drop a weapon.

===========================================================================================
strcatint("[variable]", integer)  --There are other math functions too.  Still looking at them.

Subtracts a integer from a game variable

===========================================================================================

waittimed([float])

Force the script to wait for a specified amount of time.  Example: waittimed( 0.500 ) makes the game wait 1/2 second

===========================================================================================

createPopupDialogXml('dialog name')

Runs a dialog, like "Enter the X-Jet" yes/no

===========================================================================================
ChangeActivatingHero('name')

Swaps the hero specified with whomever activated the script (see yes_swap.py in /scripts/act2/mephisto)

===========================================================================================
setActivator()

Manually sets the activator

Example:

SetActivator("_HERO1_") --Now the hero in slot 1 is the 'activator'
ChangeActivatingHero("punisher") --Now the Punisher takes the place of whoever was in slot 1.

This is useful because you can force four specific characters to be played.  Further research shows that the change is not always immediate.  Sometimes it can take 10-15 seconds to change.

===========================================================================================
soundToPlay

Forces a sound to play (usually used in a conversation)

===========================================================================================
sound("PLAY_SOUND", "[sound]", "", "" )

Play a sound via script.  Example: sound("PLAY_SOUND", "zone_shared/effects/myst_power", "", "" )

===========================================================================================
getEntityIDFromSpawnSlot

Information needed.  Semi-self explanitory

===========================================================================================
unlockHardDifficulty()

Self Explanitory

===========================================================================================
isActorOnTeam('name')

Checks to see if an actor is on your team


===========================================================================================
spawnInventoryItem('name')

Spawns 'name' from items.engb

===========================================================================================
setHudVisible(TRUE/FALSE)

Turn on/off the HUD.  Useful for 'pretty' screenies.

===========================================================================================
dangerRoomMenu() also try openmenu('danger_room')

Loads the danger room.  *might* load the XML2 main-menu style Danger Room

===========================================================================================
controlNPC(name)

Changes control over to 'name', which comes from npcstat.engb

===========================================================================================
cameraFade(0.000, 0.000 )

gets rid of the black screen that shows up after you load a level without this defined yet.  Possibly used in conjunction with the startblack = true ; setting in a level's engb.

===========================================================================================
permanentStatBoost('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

===========================================================================================
levelUp(heroID,numoflevels)

The first argument is the id of the hero you want to level up. So if you want, say to give 10 levels to your first hero, the code would be:

hero1 = getID("_HERO1_" )
levelUp(hero1, 10 )

  If name is empty, applies to all

===========================================================================================
faceEntity('name', 'entity')

Makes a character face someone/something.  Example: faceEntity('_ACTIVATOR_', 'blackwidownpc')

===========================================================================================
iadd([variable name], [number])

Adds a number to a specified game variable.  Example: iadd(deadgrunts, 1 )
Title: Modding Rundown: PY Scripts
Post by: aerophex on May 16, 2007, 06:57AM
cool list teancum, thanks.  Not having delved into the Mandarin mod, I'm not sure how a .py script gets used.  Can someone give me a quick sum up?  I'd just like to do a simple script to add XP so I don't have to start on normal and spend 3 hours in the simulator getting heroes up to lvl 30 w /o using power points. 
Title: Modding Rundown: PY Scripts
Post by: Teancum on May 17, 2007, 12:24PM
All you should need to do is add the line:

awardXPToPlayable(num)

to any script that runs on the helicarrier (Act 0).  Replace 'num' with the amount of XP you want to award.  I'm not sure how much you need to get to level 30, but you could just put that number in there. 
Title: Modding Rundown: PY Scripts
Post by: aerophex on May 18, 2007, 02:40PM
ill sit down and do the math on that one, i need practice for vegas :p.  i'll start checking it out

thanks
Title: Modding Rundown: PY Scripts
Post by: aerophex on May 19, 2007, 08:11PM
took all of 2 attempts... it's 1000000 to get all characters to level 30

thanks for the help!
Title: Modding Rundown: PY Scripts
Post by: Norrin Radd on August 06, 2007, 10:31PM
cameraFade(0.000, 0.000 )

gets rid of the black screen that shows up after you load a level without this defined yet.
When i didnt add this line in the level's py script the level would load, but the screen was completely black until i added this line

edit:
im not sure if this darkness at the beginning of loading a level has anything to do with
   startblack = true ;
defined in the eng file
Title: Modding Rundown: PY Scripts
Post by: Teancum on November 21, 2007, 10:11AM
So I posted the unlockCharacter verb wrong.  The first part is right, but in MUA, the skin variable (second part) is different somehow.

unlockCharacter('name','costume')

I think in MUA you have to do one of two things to unlock a specific costumes.  If you look at the Ghost Rider swap script you get a clue.  So it's either going to be one of two ways to unlock a fourth costume:

unlockCharacter('hawkeye','SKIN_04')

-or-

unlockCharacter('hawkeye','_04')

...because in the Ghost Rider script it uses unlockCharacter("ghostrider","SKIN").  Can anyone test this?  I'm away from my PC until Sunday night due to the holiday.

(Incidentally you can use " or '.  It doesn't matter)
Title: Re: Modding Rundown: PY Scripts
Post by: Noelemahc on March 31, 2008, 05:08AM
It's a random fact that probably was already found by someone, but could you guys check whether the script scripts/act2/strange/hulk_warmup.py exists in the PC version? It, and a few of its fellows, describes a scene, as you'd expect, where during a common dialogue the player-controlled character provokes a currently-off-the-team Hulk to deck them. I just want to know whether it's something that got dumped during the PSP port's making, or something that was in there from the start. I just don't have the PC version installed and don't currently posess the hard drive space to do so.

Because if it's a PSP-only thing, then it'd be worth scanning the other PSP level FBs in search of those other snippets of how Hulk was planned to be.
Title: Re: Modding Rundown: PY Scripts
Post by: Norrin Radd on March 31, 2008, 07:08AM
I don't see
Quote from: Noelemahc on March 31, 2008, 05:08AM
scripts/act2/strange/hulk_warmup.py
in my files of the PC version
Title: Re: Modding Rundown: PY Scripts
Post by: Noelemahc on March 31, 2008, 08:09AM
Neato. Too bad the actual dialogue lines are missing from that script, only the actions and effects are intact. There are also standard-issue dialogue scripts, but those are zero-size :(
scripts/act2/strange/talk_hulk_post.py<bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00>script<bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:f9><bh:00><bh:00><bh:00># Generated by BehavEd
# ( "This is a post script" )
cameraFade(1.000, 0.150 )
waittimed ( 0.150 )
faceEntity("hulk", "hulk_look" )
playanim (  "EA_ZONE8", "hulk", "LOOP", "" )
cameraReset( )
waittimed ( 0.150 )
cameraFade(0.000, 0.150 )

scripts/act2/strange/hulk_smash.py<bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00>script<bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00> <bh:04><bh:00><bh:00># Generated by BehavEd
# ( "The player has pissed off hulk" )
startCutScene("FALSE", "FALSE" )
cur_health = getHealth("_ACTIVATOR_" )
max_health = getHealthMax("_ACTIVATOR_" )
damage = fmul(0.300, max_health )
damage_applied = fmul(-0.300, max_health )
# ( "******************Check of the player will die if damage******************" )
playanim (  "EA_ZONE17", "hulk", "", "smash_pc" )
waittimed ( 0.150 )
spawnEffect("_ACTIVATOR_", "base/hit/hit_blocked", " 0.000 0.000 60.000 ", " 0.000 0.000 0.000 " )
waitsignal ( "smash_pc" )
if cur_health \<= damage
     # ( "The player dies" )
     setHealth("_ACTIVATOR_", 1 )
else
     new_health = iadd(cur_health, damage_applied )
     setHealth("_ACTIVATOR_", new_health )
endif
playanim (  "EA_ZONE12", "_ACTIVATOR_", "", "ko" )
waittimed ( 2.000 )
# ( "This will prevent the player from pissing off Hulk" )
setGameFlag("strange", 19, 0 )
setWaypointPath("hulk", "hulk_return", 1 )
endCutScene("FALSE", "TRUE" )
waittimed ( 1.000 )
playanim (  "EA_ZONE8", "hulk", "", "smash_pc" )

scripts/act2/strange/hulk_warmup.py<bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00>script<bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00><bh:00>~<bh:01><bh:00><bh:00># Generated by BehavEd
# ( "This sets up hulk to hit the player" )
lockConversationControls("TRUE" )
playanim (  "EA_ZONE11", "hulk", "", "roar" )
waitsignal ( "roar" )
playanim (  "EA_ZONE13", "_ACTIVATOR_", "LOOP", "" )
playanim (  "EA_ZONE15", "hulk", "", "start" )
waittimed ( 0.050 )
playanim (  "EA_ZONE16", "hulk", "LOOP", "" )
lockConversationControls("FALSE" )
Title: Re: Modding Rundown: PY Scripts
Post by: nodoubt_jr on April 30, 2008, 09:47PM
is there another way to replace/change the activator to another character? changeActivatingHero("name") doenst work on XML2, so i was hoping someone knew of another way to replace the activator or even the _HERO1_
Title: Re: Modding Rundown: PY Scripts
Post by: xkcd on July 27, 2008, 10:07PM
I've been trying to modify the files in Marvel - Ultimate Alliance\scripts\ to modify a little a few things.
I made all sorts of change and had no effect! I tried the "right" modification, "wrong" modifications to try to force an error, and got nothing! It is as if I hadn't changed anything!!
Can someone help me? Or at least give me some hint on why is this happening?
Title: Re: Modding Rundown: PY Scripts
Post by: Gevth on July 27, 2008, 10:47PM
What are you trying to do?
Title: Re: Modding Rundown: PY Scripts
Post by: xkcd on July 28, 2008, 07:04AM
Since it is my first script I was trying to do something very simple: when u meet dum dum on Omega Base for the first time, I wanted the players to win some exp points, so I added
awardXPToPlayable(1000)
to the end of meet_dum_dum.py
Actually I tried a lot of other things also, since I can program in python. Bu nothing worked! Even changing the name of the conversation to start (for testing) had no effect.
Title: Re: Modding Rundown: PY Scripts
Post by: Teancum on July 28, 2008, 09:03AM
That should work, I've used it before.  But you should know these aren't Python scripts.  This is a very specific scripting language used by Raven Software.  It's very basic and only has a handful of commands that are all inside the exe (you can find em with a hex editor).  I/the rest of the gang have listed pretty much all of the commands that are used.

How are you checking the XP?  Just going into the character menu before and after the meeting with Dugan?
Title: Re: Modding Rundown: PY Scripts
Post by: xkcd on July 28, 2008, 12:40PM
Yes, exactly.
Why? something wrong?
Title: Re: Modding Rundown: PY Scripts
Post by: Teancum on July 28, 2008, 12:44PM
Nope, just making sure you're checking correctly.  I don't know how programming savvy you are.  Also, this *might* split the value between all playables.  I have no idea.  I doubt it, but I'm throwing it out.  I'd try an astronomically larger number and see what happens.
Title: Re: Modding Rundown: PY Scripts
Post by: nodoubt_jr on July 28, 2008, 12:53PM
in xml2 this is used to unlock skin sets

unlockCharacter("", "60s" )
unlockCharacter("", "70s" )

has anybody tried
unlockCharacter("", "skin_04" )
unlockCharacter("", "skin_05" )

to see if that works (or did i miss something and we already know how to unlock skin using script)
Title: Re: Modding Rundown: PY Scripts
Post by: Teancum on July 28, 2008, 02:08PM
Yeah, I've tried it.  Trouble is the skinsets are defined differently in MUA.
Title: Re: Modding Rundown: PY Scripts
Post by: nodoubt_jr on July 28, 2008, 02:09PM
oh ok
Title: Re: Modding Rundown: PY Scripts
Post by: xkcd on July 28, 2008, 02:56PM
Well, if it should work the way I did, then probably it's something wrong with my system. (I run MUA on Linux and don't have Windows)
It is weird, since I downloaded some mods and they worked all right...
Also weird is that I used Nightcrawler mod (oficial chars) and I saw that it contained a script that apparently forced Nightcrawler to be saved from Mephisto and Phoenix dying. It didn't work and I got to save phoenix and kill nightcrawler and still play with him. (it really should do that?)
Anyway, it is frustrating...

Title: Re: Modding Rundown: PY Scripts
Post by: Gevth on July 28, 2008, 03:58PM
It might be that when you save the file after modifying it, you're saving it as meet_dum_dum.py.txt instead of saving it as meet_dum_dum.py . Anyways, here I have a file that works in my PC, and will add 1.000.000 XP to your party: http://www.sendspace.com/file/ig0qam

replace the one in scripts\act1\omega\omega1 with it, see if it works, then change the value to a reasonable one if you want.
Title: Re: Modding Rundown: PY Scripts
Post by: Teancum on July 28, 2008, 04:21PM
Quote from: xkcd on July 28, 2008, 02:56PM
Well, if it should work the way I did, then probably it's something wrong with my system. (I run MUA on Linux and don't have Windows)
It is weird, since I downloaded some mods and they worked all right...
Also weird is that I used Nightcrawler mod (oficial chars) and I saw that it contained a script that apparently forced Nightcrawler to be saved from Mephisto and Phoenix dying. It didn't work and I got to save phoenix and kill nightcrawler and still play with him. (it really should do that?)
Anyway, it is frustrating...



The script still gives you the choice, the only difference is it unlocks Nightcrawler if you save him.
Title: Re: Modding Rundown: PY Scripts
Post by: xkcd on July 28, 2008, 07:59PM
Thanks Gevth. The script worked.
But actually this was just a first test to being studying moding.
I think I've discovered the problem: (nothing regarding .py.txt. Linux don't have this Chocolate egg). The line break used in linux is Line Feed (character 13 of ASCII Table). Windows (and MUA) use Carriage Return+Line Feed (char 10 + char 13 on the ASCII table). Because of that MUA didn't recognized the line break and thought I was writing everything in the same line...
By the way, I did some testing and discovered a function that wasn't listed before.
QuotelevelUp(heroID,numoflevels)
The first argument is the id of the hero you want to level up. So if you want, say to give 10 levels to your first hero, the code would be:

hero1 = getID("_HERO1_" )
levelUp(hero1, 10 )


To level up the entire party, it would be:

hero1 = getID("_HERO1_" )
levelUp(hero1, 10 )
hero2 = getID("_HERO2_" )
levelUp(hero2, 10 )
hero3 = getID("_HERO3_" )
levelUp(hero3, 10 )
hero4 = getID("_HERO4_" )
levelUp(hero4, 10 )


Anyway, just a small contribution as a way to say thanks...
Title: Re: Modding Rundown: PY Scripts
Post by: Teancum on July 28, 2008, 08:05PM
Nice find man.
Title: Re: Modding Rundown: PY Scripts
Post by: xkcd on July 28, 2008, 09:06PM
A last discovery before going to bed...
QuotepermanentStatBoost('name','stat')
Raises a hero stat (skill, body, focus...)
Example:
permanentStatBoost('_HERO1_','skill')
Gives 1 skill point to hero1
Two new functions on my second day on the forum... I would call it a "nice" start.
Well, see ya!
Title: Re: Modding Rundown: PY Scripts
Post by: Teancum on July 29, 2008, 06:07AM
All PY functions from the exe (see the first two posts for ones we've figured out)
GREEN functions are described on the first page in more detail
BLUE functions are confirmed as broken (in MUA)

SIMULATOR/DANGER ROOM RELATED:
addSimulatorScore
closeDangerRoom
dangerRoomEndMission
endComicMissionAfterAsync
endDRScenario
getComicMissionHero -- gets the current hero
getComicMissionVillain
getDangerRoomActive
incrementSimulatorObjectivesScore
loadComicMissionNow
loadMapOpenMenu
loadSim
loadSimulatorComicMission --Hmm, could missions like Norrin's Colossus mission be loaded this way, and thus counted as a comic mission to give us rewards outside of the normal simulator?  (in other words, add this after the last VISIBLE comic mission.  It would still be a comic mission, but wouldn't show up on the list.  That'd give us rewards, but not be in the list)
setComicMissionHeroPlayer --perhaps useful to set the hero AFTER going into a mission (allowing us to give that hero rewards), but it may set the player (person actually playing) and not the character
setDangerRoomFailed
setDangerRoomSuccess
setSimulatorEntDestroyedset
SimulatorSpawnSlotEnabled



SAVE/LOAD:
saveloadAbort
saveloadBootDeleteCorrupt
saveloadChooseCorrupt
saveloadChooseFile
saveloadCleanUp
saveloadCompleteLoad
saveloadDefaultCheck
saveloadDefaultCheck2
saveloadDeleteCorrupt
saveloadDeleteFile
saveloadDeleteSuccess
saveloadFormat
saveloadImageCheck
saveloadLoadOptions
saveloadLoseGameState
saveloadNoSpaceWarning
saveloadOverwrite
saveloadOvrWriteOpts
saveloadOvrWriteOptsAsk
saveloadProcess
saveloadSaveConfirmed
saveloadSelectDevice



CHARACTER/TEAM RELATED:
actSilent
addBolton --Adds a bolton programatically to a character
addXtremePip --Either fills the Xtreme meter, or gives you a certain amount of momentum: POSSIBLE USAGE: addXtremePip([integer])
allowConversation
allowConvIfName --If 'character' started the conversation, allow a special convo
allowResponseOnGameVarCount --Allows conversations based on how many game vars are completed.  Might allow for custom variables.  For instance, create a variable that says you have to talk to Black Widow and Vision before allowing a specific response to Nick Fury's conversations.
attackEntityWithType
beATeamPlayer("NPC", TRUE/FALSE) --sets whether a NPC will fight along with the team
controlNPC -- Cool, maybe like Havok in XML1 during the Weapon X mission?  USAGE FROM AN EXISTING SCRIPT (doesn't seem to work):  ControlNPC('heroID', 'NPCname', 'TRUE/FALSE')
controlPlayerHeroWithAI
copyOAndANonActivators
copyOriginAndAngles --Moves something to something's else's location
disallowResponse --Turns of a response in a conversation?
disallowResponseOnObjective
disallowResponseOnVar --See allowResponseOnGameVarCount
dropWeapon --Forces a character to drop a weapon (used in sim missions before you enter the boss room)
enableTargets
faceEntity
fadeIn --Fade the hero in/out, or the camera?  (needs research)
fadeOut --Fade the hero in/out, or the camera?  (needs research)
getAIControlled
getConversationActive
getHealth
getHealthMax
getHeldWeapon --Gets the name of the held weapon from weapons.engb?
getHeroID --Gets the hero's unique ID
getHeroName --Get's the hero's name
getName --Gets the NPC or hero's name
getParentID --Get's the parent of something
isActorInList --you pass in a character name (I.E. "ironman"), and pass in a delimited string of name, and it will tell you if the character name is within that list of names, so say you got an event where Ironman, cap, and spidey will do certain things, you can check to see if the hero the player is playing is one of those guys.
isActorOnTeam
killEntity
killEntitySilent('name') --Kills an entity.  Not sure what the silent part is about, but it works
levelUp
lockCharacter
loopCombatNode --Takes the Entity Name, The Combat Node Name and the LoopTypename. And it will loop the node.
moveHeroesToEnt('entity') --move the heroes to a specific entity (an object, invisible object, enemy, etc)
moveToEntity
myteamConfirm
permanentStatBoost
playanim --Works, don't have an example of usage on hand
playCombatNodeTrigger
removeBolton --Add/Remove boltons via script.  Might be useful for per-skin boltons
resurrect --Resurrects.  Usage unknown
reviveHeroes --Revives all heroes?
reviveTeam --Revives all heroes currently in play?
setActorScaleTimed
setAggression
setAIActive
setAIActive2
setAlpha
setBossUndying
setCanMove --can move Yes/No?
setCombatNode -- Makes a character use an ability from his powerstyle or fightstyle. Example: setCombatNode("penance", "power6" )->Penance will use power6, as defined in his powerstyle.
setDefaultTarget
setDestroyObjects
setFlee
setFollowingHero
setHealth
setHealthMax
setHomingID
setInvisible
setInvulnerable
setMyteamType
setName --used in some /scripts/act4/skrull/skrull5 scripts
setNoTarget
setParent
setPathIgnore
setPatternSequence --Sets the button pattern sequence from some other file, used in some /scripts/act4/skrull/skrull5 scripts
setSegmentVisible --Perhaps similar to hideskin in the herostat
setSkin
setteam --Sets the AI to a defined team.  For example, SetTeam("BEHAVED_TEAM_HERO", "havok") will make Havok fight alongside the heroes
setTeamFollow
setTeamInvisible --Makes the whole team invisible (YES/NO or 0/1)
setUndying
setVictim
setWaypointPath
showHealthBar --(0/1) on/off
spawnEffect
spawnEffectBone --Spawns an effect based on a character's bone
startCharConversation
startConversation
stopHoldAI
swapInStump("entity") --replaces an entity with the "stump" (broken) version defined in the engb
unlockCharacter



MISSION/ZONE/LEVEL RELATED:
checkpointRecover
checkpointSave
extractionPoint
extractionPointChange
extractionPointLite
extractionUnlock
getObjective
getZoneFlag
getZoneReset
getZoneVar
immediateObjective
isBlinkPortalActive -- Is the teleport portal open?
isExtractionPointUnlocked -- Yes/No (think of Murderworld before the Pitfall game)
loadMap
loadMapAddTeam --Loads the map but lets you choose your team, resetting everything in a level
loadMapKeepTeam --Loads the map with the same team you had, resetting everything in a level
loadMapStartGame --Loads the starting map (first level)
loadZone --loads a level, keeping any changes you had before persistent (broken boxes, dead enemies, etc)
loadZoneAddTeam --Loads the map but lets you choose your team, keeping any changes you had before persistent (broken boxes, dead enemies, etc)
recallZone -- Teleport back to current zone? (from Headquarters?)
restartZone
restorelastzone
setAmbientLightColor
setBossPartyLightColor
setBossPartyLightColorNG
setBossPartyLightEntity
setPartyLightColor
setPartyLightColorNG
setPartyLightRadiusScale
setPartyLightRadiusScaleNG
setZoneFlag
setZoneVar
startFirstMission
zoneLink

***Any verbs that have "Map" in them will reset the level back to default.  Any with "Zone" in them will load the level just as you left it, with enemies killed, boxes broken, etc.


MENUS/DIALOGS:
blackbirdMenu -- Interesting...
codexMenu --DEBUG MENU??
createPopupDialogXml -- Stuff like "Enter the X-Jet?"
createPopupDialogXmlFilter -- Stuff like "Enter the X-Jet?" w/unknown filter
dangerRoomMenu
codexMenu -- Opens the character bio menu.  Files must be copied from XML2 (see next page)
imageViewer -- review menu?
personalItem
reviewCinematics -- a review tab
reviewComics -- a review tab
reviewConcept -- a review tab
reviewLoadScreens -- a review tab
reviewMenu
shopMenu -- Opens shop, but you need to copy the files over from XML2 (see next page)
triviaMenu



CAMERA RELATED:
cameraFade
cameraFocusToEntity
cameraFocusToEntityYaw
cameraFocusToEntityYawAndOffset
cameraFollowMotionPath
cameraFollowMotionPathRelative
cameraFOV -- sets FOV
cameraFreeFOV -- clears custom FOV set by cameraFOV?
cameraMove
cameraMoveRelative
cameraPan
cameraReset
cameraResetOldSchool
cameraSetClipPlane
cameraShake
cameraToEntityAngles
cameraToLocationAngles
overrideFocusToEntity



MISC:
actionFigureReward
addObjectiveCategory -- Main or side objective?
awardAchievement -- (Xbox 360 only)
awardReputation
awardXPToPlayable
beginMission('name')
beginMissionHack -- DEBUG?
bootToDash (likely console-only)
causeTroubleForAutotest -- DEBUG? -Tested and could not get to work
changeActivatingHero
cinematicEnd
cinematicStart
closemenu
command
confirmMenuCancel
dataDiscReward
display
endCutScene
enemiesNoTarget
fadeLightsWithSounds
forceWin
gameover
gameOverLoadGameDialog
getDifficultyLevel --If difficulty is easy, set it to hard  :D
getDistance
getEnable
getEntityIDFromSpawnSlot
getEpilogue
getGameFlag
getGameVar
getGameVarBitCount
getHeldHero
getID
getIDString
getNearestMonsterSpawner
getOpened
getPosX
getPosY
getPosZ
getTimeRemaining
heroNoTarget
hudMessage
initHud
LaunchFeedbackMenu --LIKELY DEBUG
loadNetworkConfig
lockCombat
lockControls
lockConversationControls
mainMenuExit
mainMenuExitDialog
missionComplete --Finished a mission
missionComplete2 --Possibly finished a mission through a different way (I.E. destroying a console instead of disabling it)
multiplayerCancelPlayer
multiplayerCommitPlayer
newMissionBriefing
NoTickle -- a real function, no joke
openmenu
playBossSound
randomInt
restoreEnergy
restoreHealth
saveEpilogue
secretFound
SendFeedbackToggleMute
setAngles
setAnimSpeed
setAutoEquip -- Auto Equip items YES/NO
setAutoSpend -- Auto Spend points YES/NO
setCameraMagnetTarget
setCharSwitchingOn
setCompetitiveCoop
setCoopMode -- Competitive or not
setCurrentAct
setDangerLevel
setDifficultyLevel
setEnable
setEpilogue
setGameFlag
setGameSpeed --Hyperspeed, baby! -Might be what slowed you down during Avalanche fights in XML1
setGameVar
setGoal
setHintType
setHudVisible
setLaserTarget
setMusicOverride
setNoClip
setNoCollide
setNoGravity
setNoShadow
setOrigin
setPosX
setPosY
setPosZ
setRecallActive -- Can you teleport back to headquaters? (set to yes/no)
setRotZ
setScale
setSpecialMode
setStructure
setUnderWater
setVelocity
spawnInventoryItem("item", "_OWNER_") --spawns an inventory item
startButtonComboChallenge --Shows up in quite a few button challenge sections, but seems to call the combo itself from somewhere else
startCutScene
startGameDiffDialog
startMotionPath
startMovie
startVideoRecord
stopVideoRecord
timerAdd(int) --adds time to a timer.  Can be negative to remove time.
timerStart(300, 10, "act1/NYC/NYCTimesSquare/timeUp")
titleUpdate
unlockHardDifficulty
useDefaultStats
useSavedStats
vibrate
wanderNextZoneLink -- DEBUG?
strcatint("string", Int) --adds a string and an int together.  "blue" and 1 would produce "blue1"

Title: Re: Modding Rundown: PY Scripts
Post by: Teancum on August 06, 2008, 09:19AM
I alphabetized the list.  Hopefully that will help folks find functions faster.
Title: Re: Modding Rundown: PY Scripts
Post by: Teancum on August 14, 2008, 07:30PM
Just some fun usage.  Here's how to programatically add and remove a bolton:

Add a bolton
hero1 = getID("_HERO1_" )
addBolton(hero1, "models/boss_loki/sword_bloki_w", "Bip01 R Hand", "grab1", 1 )

Remove a bolton
hero1 = getID("_HERO1_" )
removeBolton(hero1, 1 )
Title: Re: Modding Rundown: PY Scripts
Post by: Teancum on August 14, 2008, 08:14PM
I give you the Equip section of the Shop menu.  Achieved by copying everything from XML2/ui/menus, then saying 'no' to all overwrites.  After that I added this line to my script.  You MUST do this to get these menus to appear in MUA.

shopMenu("equip")
(http://img187.imageshack.us/img187/5739/87320395rx0.jpg)

codexMenu(1) and codexMenu(0) --Used for viewing heroes/villains
(http://img175.imageshack.us/img175/1214/70406631wu2.jpg)
Title: Re: Modding Rundown: PY Scripts
Post by: Teancum on August 15, 2008, 06:29AM
I added a bunch more script descriptions last night to the first two posts.  See them for a description.  Also, on page 2 I've set a bunch of functions to green that I know work, and tried to comment on some other ones.

setFollowingHero("character", "TRUE/FALSE" )
spawnEffect("[entity]", "[effect]", " [x/y/z] ", " [p/y/r] " )
alive("[entity]")
cameraShake(4.000, 3.000 )
vibrate("ENTITY", "RUMBLE", 0.200, 2.200 )
gameover("[something from strings.engb]")
lockControls(float)
dropWeapon("[entity]", "TRUE/FALSE" )
strcatint("[variable]", num )
waittimed([float])
createPopupDialogXml('dialog name')
iadd([variable name], [number])
Title: Re: Modding Rundown: PY Scripts
Post by: Teancum on August 23, 2008, 02:14PM
More PY functions:


instring --probably checks to see if some sort of value exists in a string.  So if you were looking for "Ghost" in the string "Ghost Rider is cool" it would find it?
strveci --dunno
strcatstr --see pg1
idiv --divides two integers
imul --multiplies two integers
isub --subracts two integers
iadd --adds two integers
fdiv --divides two floats
fmul --multiplies two floats
fsub --subracts two floats
fadd --adds two floats
waitsignal --waits for the 'ok to skip' signal from a cinematic
waittimed --waits [a] number of milliseconds?
Title: Re: Modding Rundown: PY Scripts
Post by: Teancum on September 05, 2008, 04:39PM
So I've done lots and lots and lots of experimenting, only to find out the codex menu (character bios) won't work in MUA.  There are EXE calls that it needs that are missing in MUA (but present in XML2).  I can actually get it to review characters in XML2, but not MUA.
Title: Re: Modding Rundown: PY Scripts
Post by: Gevth on August 19, 2009, 08:00PM
Quote from: Teancum on April 19, 2007, 06:04PM
Definition of specific static values

"_HERO1_" --First hero slot
"_HERO2_" --Second hero slot
"_HERO3_" --Third hero slot
"_HERO4_" --Fourth hero slot
"_OWNER_" --Performs verb on whoever called it
"_ACTIVATOR_" --Similar to _OWNER_, but used when you activate something.  (A good example is picking up a focus upgrade)

I found this one today:
"_ACTIVE_HERO_" -- Name explains itself, it's the character the player currently uses.
Title: Re: Modding Rundown: PY Scripts
Post by: Teancum on August 20, 2009, 05:16AM
Huh, I can't believe I never added that.  Used to use it all the time.  Thanks Gevth!
Title: Re: Modding Rundown: PY Scripts
Post by: Unknown on August 21, 2009, 02:17PM
So Teancum was using the hero thing, did it work?
Title: Re: Modding Rundown: PY Scripts
Post by: the master$$$ on August 21, 2009, 03:00PM
you can see it in the cam mod,personaly i  think it works lol
Title: Re: Modding Rundown: PY Scripts
Post by: the master$$$ on August 22, 2009, 12:55PM
Hey is there any disabeling and enabeling script function,or something like that?It would realy come in handy to fix the cutscene problem for the cam mod!
Title: Re: Modding Rundown: PY Scripts
Post by: Teancum on August 22, 2009, 01:03PM
Nope.  That's why I never did it, because you'd need to edit every single script to account for it.
Title: Re: Modding Rundown: PY Scripts
Post by: Unknown on August 22, 2009, 05:21PM
And who has that amount time on their hands? How many .py scripts are their? Let's see a few for every simulator then there's the missions and other stuff I have no idea about. So it's alot of time just to edit them.
Title: Re: Modding Rundown: PY Scripts
Post by: Teancum on August 22, 2009, 08:25PM
You're looking at least 150 scripts.  Each one of those has to be modified, and they won't always be able to be modified in the same way.
Title: Re: Modding Rundown: PY Scripts
Post by: Gevth on September 06, 2009, 12:02PM
Does anybody know a script file that includes setActivator ? Because I'm currently using it in a script (I've tried both setActivator("_HERO1_") and setActivator("captainamerica")), and it's not turning anyone to an _ACTIVATOR_. I'd like to check how it's implemented in context.

On the other side, apparently playanim can only play animations from the character's own animation files (xx_character.igb, etc.), since none of the inputs refer to a file (as opposed to other functions, like sound). I'll get deeper into this later.
Title: Re: Modding Rundown: PY Scripts
Post by: Teancum on September 06, 2009, 12:30PM
SetActivator() has to be called by activating something, like a terminal.  When it's activated you can change it via SetActivator().  At least that's what I've found.  I've had a lot of problems with that verb.
Title: Re: Modding Rundown: PY Scripts
Post by: Gevth on September 06, 2009, 05:42PM
Bummer, guess that means changeActivator can't be called from powerstyles. Thanks for the info.
Title: Re: Modding Rundown: PY Scripts
Post by: Gevth on May 16, 2011, 03:51PM
Added the following entry in Teancum's list in page 2:

setCombatNode -- Makes a character use an ability from his powerstyle or fightstyle. Example: setCombatNode("penance", "power6" )->Penance will use power6, as defined in his powerstyle.
Title: Re: Modding Rundown: PY Scripts
Post by: iammingy on April 20, 2012, 12:24AM
I don't think this is documented:

act("name of entity to use", "name of the character" )
Title: Re: Modding Rundown: PY Scripts
Post by: Teancum on March 01, 2013, 09:03AM
GREEN functions work (in MUA, may work in XML2 as well)
BLUE functions are confirmed as broken in MUA
ORANGE functions don"t seem to work in XML2/MUA

Definition of specific static global calls
"_HERO1_" --First hero slot
"_HERO2_" --Second hero slot
"_HERO3_" --Third hero slot
"_HERO4_" --Fourth hero slot
"_OWNER_" --Performs verb on whoever called it
"_ACTIVATOR_" --Similar to _OWNER_, but used when you activate something.  (A good example is picking up a focus upgrade)
"_ACTIVE_HERO_" -- Name explains itself, it's the character the player currently uses.



SIMULATOR/DANGER ROOM RELATED:
addSimulatorScore(integer) -- adds a score to the current sim mission
addSimulatorScore(200000 )
closeDangerRoom --unused in MUA, may be used in XML2
dangerRoomEndMission --unused in MUA, may be used in XML2
endComicMissionAfterAsync --unused in MUA
endDRScenario --unused in MUA, may be used in XML2
getComicMissionHero -- gets the current hero, returns their name (not ID) from herostat
hero = getComicMissionHero( )
getComicMissionVillain --gets the villain, returns their name (not ID) from npcstat
villain = getComicMissionVillain( )
getDangerRoomActive --unused in MUA, may be used in XML2
incrementSimulatorObjectivesScore(integer) --used for the fights against Winter Soldier and Warstar. Seems to be used when there are multiple pieces to a simulator objective (like destroying several beams in the Warstar fight).
incrementSimulatorObjectivesScore(500 )
loadComicMissionNow --unused in MUA. See loadSimulatorComicMission() below as this verb may relate to that, starting the mission immediately instead of bringing up the "start mission now?" prompt
loadMapOpenMenu
loadSim --unused in MUA
loadSimulatorComicMission("mission name") --Loads a sim mission. Usually during pickup of a sim disc. Brings up a "start mission now?" prompt to allow the player to choose to play the mission now or later.
loadSimulatorComicMission('CMBLACKWIDOWVV')
setComicMissionHeroPlayer --perhaps useful to set the hero AFTER going into a mission (allowing us to give that hero rewards), but it may set the player (person actually playing) and not the character
setDangerRoomFailed() --fails the Danger Room/Simulator scenario.
setDangerRoomFailed( )
setDangerRoomSuccess --wins the Danger Room/Simulator scenario.
setDangerRoomSuccess( )
setSimulatorEntDestroyedset --not used in MUA
SimulatorSpawnSlotEnabled(integer, "TRUE/FALSE", "TRUE/FALSE") --enables/disables a spawn slot. More research needed, but is used in a few simulator missions.
setSimulatorSpawnSlotEnabled(5, "FALSE", "TRUE" )


SAVE/LOAD:
saveloadAbort
saveloadBootDeleteCorrupt
saveloadChooseCorrupt
saveloadChooseFile
saveloadCleanUp
saveloadCompleteLoad
saveloadDefaultCheck
saveloadDefaultCheck2
saveloadDeleteCorrupt
saveloadDeleteFile
saveloadDeleteSuccess
saveloadFormat
saveloadImageCheck
saveloadLoadOptions
saveloadLoseGameState
saveloadNoSpaceWarning
saveloadOverwrite
saveloadOvrWriteOpts
saveloadOvrWriteOptsAsk
saveloadProcess
saveloadSaveConfirmed
saveloadSelectDevice



CHARACTER/TEAM RELATED:
act("name of entity to use", "name of the character" )
act("name of entity to use", "name of the character" )
actSilent("name of entity to use", "name of the character" )
act("name of entity to use", "name of the character" )
addBolton --Adds a bolton programatically to a character.
hero1 = getID("_HERO1_" )
addBolton(hero1, "models/boss_loki/sword_bloki_w", "Bip01 R Hand", "grab1", 1 )

addXtremePip(integer) --Either fills the Xtreme meter, or gives you a certain amount of momentum. Unknown usage
allowConversation("TRUE/FALSE") --allow conversation. Useful if you want certain things to be completed before the convo can be had.
allowConversation("TRUE")
alive("entity") --Checks to see if someone is alive. 
alive("spiderman") --would see if Spidey's alive
allowConvIfName("_ACTIVATOR_", "name") --If "character" started the conversation, allow a special convo
allowConvIfName("_ACTIVATOR_", "blackpanther") --only black panther can have this conversation
allowResponseOnGameVarCount --Allows conversations based on how many game vars are completed.  Might allow for custom variables.  For instance, create a variable that says you have to talk to Black Widow and Vision before allowing a specific response to Nick Fury's conversations.
attackEntityWithType
beATeamPlayer("NPC", "TRUE/FALSE") --sets whether a NPC will fight along with the player team
beATeamPlayer("corsair", "TRUE") --Corsair with fight with the player heroes
beATeamPlayer("nicfury_npc", True)
controlNPC("heroID", "NPCname", "TRUE/FALSE") -- Cool, maybe like Havok in XML1 during the Weapon X mission?
controlNPC(who, "silversurfer", "FALSE" )
controlPlayerHeroWithAI(float) --lets the Active Hero be moved on a waypoint path for a specified time, then returns it to the player. -1.000 will give control infinitely, while 0.100 lets the AI control for 1/10 of a second, then returns it to the player.
controlPlayerHeroWithAI(-1.000 )
copyOAndANonActivators("location1", "location2", "location3") --moves the non-activating heroes elsewhere. Used often in conversations to ensure the three other characters aren't in the camera view.
copyOAndANonActivators("fury_spot01", "fury_spot02", "fury_spot03" )
copyOriginAndAngles("object to move", "place to move it") --Moves something to something's else's exact location
copyOriginAndAngles("final_left_bead", "orb_left_null" )
disallowResponse --Turns of a response in a conversation?
disallowResponseOnObjective
disallowResponseOnVar --See allowResponseOnGameVarCount
dropWeapon --Forces a character to drop a weapon (used in sim missions before you enter the boss room)
dropWeapon("[entity]", "TRUE/FALSE" )
enableTargets("entitiy")
enableTargets("_OWNER_" )
faceEntity
fadeIn --Fade the hero in/out, or the camera?  (needs research)
fadeOut --Fade the hero in/out, or the camera?  (needs research)
getAIControlled --checks to see if the hero that did something is currently being controlled by AI and not the player
AI = getAIControlled("_ACTIVATOR_" )
getConversationActive --Checks to see if a conversation is running.  Returns 1 for yes, 0 for no. May require a conversation name, or may just be a check to see if the player is talking to someone
getHealth('entity') --gets the current health of an entity
getHealth('radioactiveman')
getHealthMax('entity')
getHealthMax('radioactiveman')
getHeldWeapon("entity") --Gets the name of the held weapon from weapons.engb
weapon_name = getHeldWeapon("_ACTIVATOR_" )
getHeroID("hero")--Gets the hero's unique ID. The ID can be stored in a game flag. For example, whoever sacrifices themself to free Ghost Rider get's their ID stored in a game flag (saved), later on that ID is retrieved when they can be used again.
activator_name = getName("_ACTIVATOR_" )
locked_char_id_num = getHeroID(activator_name )
setGameVar("sacd_hero", locked_char_id_num )

getHeroName --Gets the hero's name
GetHeroName("_HERO1_") --gets the name of the hero in the first playable slot
getName("global" ) --Gets the NPC or hero's name
getName("_ACTIVATOR_" ) --gets who activated a conversation
getParentID --Get's the parent of something
isActorInList --you pass in a character name (I.E. "ironman"), and pass in a delimited string of name, and it will tell you if the character name is within that list of names, so say you got an event where Ironman, cap, and spidey will do certain things, you can check to see if the hero the player is playing is one of those guys.
run_default = isActorInList("_ACTIVATOR_", "iceman storm wolverine" )
isActorOnTeam('name') --Checks to see if an actor is on your team. Refers to active team and not all playables.
isActorOnTeam('ironman')
killEntity("name") --Kills an entity. *MIGHT* remove the entity as well?
killEntity('scorpion")
killEntitySilent("name") --Kills an entity.  Not sure what the silent part is about, but it works
levelUp
lockCharacter('name', 'skin name') --locks a playable character until unlocked with unlockCharacter(). Skin name is optional, and does not work in MUA
lockCharacter('deadpool', 'aoa') --locks Deadpool and/or his AoA costume
loopCombatNode --Takes the Entity Name, The Combat Node Name and the LoopTypeName. And it will loop the node.
moveHeroesToEnt("entity") --move the heroes to a specific entity (an object, invisible object, enemy, etc)
moveToEntity("actor", "place to move to") --moves an actor to a specified entity
moveToEntity("_HERO1_", "hero1here" )
myteamConfirm
permanentStatBoost("name", 'stat") --Raises a hero stat (skill, body, focus...). permanentStatBoost("_HERO1_",'skill")
playanim --Works, don"t have an example of usage on hand
playCombatNodeTrigger
removeBolton --Add/Remove boltons via script.  Might be useful for per-skin boltons. Example: hero1 = getID("_HERO1_" )
removeBolton("_HERO1_", 1 )

resurrect("actor") --Resurrects a dead member of the team
resurrect("ironman" )
reviveHeroes --Revives all heroes?
reviveTeam --Revives all heroes currently in play?
setActorScaleTimed
setAggression
setAIActive("name", "TRUE/FALSE") --turns an AI on or off
setAIActive("scorpionNPC", "FALSE")
setAIActive2 --unknown. Usage is probably the same as above, but maybe it allows you to differentiate between two characters?
setAllAIActive("TRUE/FALSE") --turns ALL AI in a level on or off
setAllAIActive(, "FALSE")
setAlpha
setBossUndying
setCanMove("entity", "TRUE/FALSE") --sets whether an actor can move
setCanMove("scorpion", "FALSE")
setCombatNode -- Makes a character use an ability from his powerstyle or fightstyle. setCombatNode("penance", "power6" ) --Penance will use power6, as defined in his powerstyle.
setDefaultTarget
setDestroyObjects
setFlee
setFollowingHero("character", "TRUE/FALSE" ) --Sets a character to follow the player.  A good example is Dr Strange in Mandarin's palace (before you unlock him)
setFollowingHero("drstrangeNPC", "TRUE" )
setHealth("entity", integer) --Changes the entity's health to the number specified
setHealth("_ACTIVATOR_", 1 )
setHealthMax("entity", integer) --Sets the max health an entity can have
setHealthMax("_ACTIVATOR_", 100 )
setEnergy("entity", integer) --Changes the entity's energy to the number specified
setEnergy("_ACTIVATOR_", 1 )
setEnergyMax("entity", integer) --Sets the max energy an entity can have
setEnergyMax("_ACTIVATOR_", 100 )
setHomingID
setInvisible
setInvulnerable("name", "TRUE/FALSE") --makes a given character invincible
setInvulnerable("LukeCage", "FALSE" )
setMyteamType
setName --used in some /scripts/act4/skrull/skrull5 scripts
setNoTarget
setParent
setPathIgnore
setPatternSequence --Sets the button pattern sequence from some other file, used in some /scripts/act4/skrull/skrull5 scripts
setSegmentVisible("actor", "skin segement", 0/1) --Turns a skin segment on or off. 1 for on, 0 for off.
setSegmentVisible("nick_fury", "gun_left_segment", "0" )
setSkin("actor", "skin number" --Sets a character to have a specific model.  Looking in the IGB list we know that Luke Cage is 157.  His first skin is 01, so we"d use:
setSkin("LukeCage", "15701")
setTeam --Sets the AI to a defined team.
SetTeam("BEHAVED_TEAM_HERO", "havok") --will make Havok fight alongside the heroes
setTeamFollow
setTeamInvisible --Makes the whole team invisible (YES/NO or 0/1)
setUndying("actor", "TRUE/FALSE") --Sets an actor to undying or not (can't be killed). Not sure how this differs from invincibility
setUndying("corsair", "TRUE" )
setVictim("victim actor", "damaging actor") --Sets who should take damage from whom. Seems to be mostly related to button challenge minigames.
setVictim("ymir", "_ACTIVATOR_" )
setWaypointPath
showHealthBar --(0/1) on/off
spawnEffect("[entity]", "[effect]", " [x/y/z] ", " [p/y/r] " ) --Spawns an effect on an entity. 
spawnEffect("cyclops_scripted", "powers/mystique_morph", " 0.000 0.000 0.000 ", " 0.000 0.000 0.000 " )
spawnEffectBone --Spawns an effect based on a character's bone
startCharConversation
startConversation
stopHoldAI
swapInStump("entity") --replaces an entity with the 'stump" (broken) version defined in the engb
unlockCharacter("name","costume")**Note, in XML1, the verb is charUnlock()
We"ll use XML2 Deadpool as an example.
unlockCharacter("deadpool", " aoa")
Here's how it works.  If you want to unlock a character for playing, you would enter unlockCharacter("deadpool", " ").  This will unlock him and his Age Of Apocalypse costume. If you want to unlock a specific costume (XML2 only) for a character, you specify it.  You can figure out what they are by looking in the herostat.  Look for skin_[name].  The [name] part is what we need.  So in this case we can use unlockCharacter("deadpool","astonishing").  You can also unlock specific costume sets only by using unlockCharacter("","costume").  So for Age Of Apocalypse costumes it would be unlockCharacter("name","aoa")

This also works on characters you haven"t unlocked yet.  They will stay locked until you unlock them, but these skins will be unlocked when you unlock the character.  And all you"d need to do is stick this in any script that runs before the first extraction point.  Technically you can put it anywhere, but it makes sense to put it before the first point so all skins are unlocked the first time you can change teams.

NOTE: We haven"t figured out how to unlock costumes with this command in MUA yet
Title: Re: Modding Rundown: PY Scripts
Post by: Teancum on March 01, 2013, 09:54AM
(continued)...

MISSION/ZONE/LEVEL RELATED:
checkpointRecover --Unused in MUA
checkpointSave() --Saves a checkpoint. Has no parameters.
checkpointSave( )
extractionPoint() --activates the extraction point
extractionPoint("_OWNER_" )
extractionPointChange --Unused in MUA
extractionPointLite --Unused in MUA
extractionUnlock() --unlocks the extraction point
extractionUnlock("" )
getObjective
getZoneFlag
getZoneReset
getZoneVar
immediateObjective
isBlinkPortalActive -- Is the teleport portal open?
isExtractionPointUnlocked() --Checks to see if the extraction point is unlocked. Returns 1 if true.
unlocked = isExtractionPointUnlocked( )
if unlocked == 1
     # do stuff
endif

loadMap
loadMapAddTeam --Loads the map but lets you choose your team, resetting everything in a level
loadMapKeepTeam --Loads the map with the same team you had, resetting everything in a level
loadMapStartGame --Loads the starting map (first level)
loadZone --loads a level, keeping any changes you had before persistent (broken boxes, dead enemies, etc)
loadZoneAddTeam --Loads the map but lets you choose your team, keeping any changes you had before persistent (broken boxes, dead enemies, etc)
recallZone -- Teleport back to current zone? (from Headquarters?)
restartZone
restorelastzone
setAmbientLightColor
setBossPartyLightColor
setBossPartyLightColorNG
setBossPartyLightEntity
setPartyLightColor
setPartyLightColorNG
setPartyLightRadiusScale
setPartyLightRadiusScaleNG
setZoneFlag
setZoneVar
startFirstMission
zoneLink

***Any verbs that have "Map" in them will reset the level back to default.  Any with "Zone" in them will load the level just as you left it, with enemies killed, boxes broken, etc.


MENUS/DIALOGS:
blackbirdMenu -- Interesting...
codexMenu --DEBUG MENU??
createPopupDialogXml -- Stuff like "Enter the X-Jet?"
createPopupDialogXmlFilter -- Stuff like "Enter the X-Jet?" w/unknown filter
dangerRoomMenu
codexMenu -- Opens the character bio menu.  Files must be copied from XML2 (see next page)
imageViewer -- review menu?
personalItem
reviewCinematics -- a review tab
reviewComics -- a review tab
reviewConcept -- a review tab
reviewLoadScreens -- a review tab
reviewMenu
shopMenu -- Opens shop, but you need to copy the files over from XML2 (see next page)
triviaMenu



CAMERA RELATED:
cameraFade(time?, fade value?) --fades camera in and out. Exact usage unknown.
cameraFocusToEntity
cameraFocusToEntityYaw
cameraFocusToEntityYawAndOffset
cameraFollowMotionPath
cameraFollowMotionPathRelative
cameraFOV -- sets FOV
cameraFreeFOV -- clears custom FOV set by cameraFOV?
cameraMove
cameraMoveRelative
cameraPan
cameraReset
cameraResetOldSchool
cameraSetClipPlane
cameraShake(shake size (float), shake duration (float)) --Vibrates the screen.  The two numbers represent how big and long the vibration is.
cameraShake(4.000, 3.000 )
cameraToEntityAngles
cameraToLocationAngles
overrideFocusToEntity



MISC:
actionFigureReward --Unused in MUA
addObjectiveCategory --Main or side objective?
awardAchievement -- (Xbox 360 only, thus no example)
awardReputation("", "integer") --awards reputation. Usage typically has first parameter empty. The first parameter is likely when you only want to award rep for a specific character, but it is never used
awardReputation("", 50 )
awardXPToPlayable(integer) --Awards XP to all playable characters (untested on NPCs with playable=true added)
awardXPToPlayable(25000 )
beginMission("name")
beginMissionHack -- DEBUG?
bootToDash (likely console-only)
causeTroubleForAutotest -- DEBUG? -Tested and could not get to work
setActivator() --Manually sets the activator
SetActivator("_HERO1_") --Now the hero in slot 1 is the 'activator'
ChangeActivatingHero("punisher") --Now the Punisher takes the place of whoever was in slot 1.

This is useful because you can force four specific characters to be played.  Seems to be tied to conversations (in other words, it would change whoever talked to this NPC)
changeActivatingHero('name') --Swaps the hero specified with whomever activated the convo
cinematicEnd
cinematicStart
closemenu
command
confirmMenuCancel
dataDiscReward
display
endCutScene("TRUE/FALSE", "TRUE/FALSE" ) --ends a cutscene. See startCutScene above for usage
enemiesNoTarget
fadeLightsWithSounds
forceWin
gameover("[something from strings.engb]") --Brings up the Game Over menu, with text that says why from strings.engb.  For instance: GAME OVER - Innocents were killed
gameOverLoadGameDialog --same as above, but with an option to load a game
getDifficultyLevel --If difficulty is easy, set it to hard  :D
getDistance
getEnable
getEntityIDFromSpawnSlot
getEpilogue
getGameFlag("zone name", desired flag number) --gets a flag for this zone from the player's save file
first_visit = getGameFlag("Heli1", 1 ) --checks to see if this is the first playthrough
getGameVar
getGameVarBitCount
getHeldHero
getID
getIDString
getNearestMonsterSpawner
getOpened
getPosX
getPosY
getPosZ
getTimeRemaining
heroNoTarget
hudMessage
initHud
LaunchFeedbackMenu --LIKELY DEBUG
loadNetworkConfig
lockCombat
lockControls(float) --Locks the controls for a specified amount of time. 
lockControls(0.100 ) --locks the controls for 1/10 of a second
lockConversationControls --presumably works the same as lockControls(), but locks them in a conversation. Might be useful if you want to force the player to read soemthing
mainMenuExit
mainMenuExitDialog
missionComplete --Finished a mission
missionComplete2 --Possibly finished a mission through a different way (I.E. destroying a console instead of disabling it)
multiplayerCancelPlayer
multiplayerCommitPlayer
newMissionBriefing
NoTickle -- a real function, no joke
objective("objective name", "command") --does something with an objective. Known commands are below
objective ( "Heli_Obj0",  "EOBJCMD_SHOW" ) --displays the Heli_Obj0 objective on screen
objective ( "Heli_Obj0", "EOBJCMD_COMPLETE" ) --sets Heli_Obj0 objective as complete
objective ( "sentinel2",  "EOBJCMD_INCREMENT" ) --increments sentinel2 objective (for things like "Destroy 5 sentinels" this increments the number destroyed

openmenu
playBossSound
randomInt(num1 , num2) --Returns a random integer between (and including) the values of num1 and num2.
randomInt(1, 5) --returns a random number from 1 to 5
restoreEnergy --returns energy to whatever the max value is set to?
restoreHealth --returns health to whatever the max value is set to?
saveEpilogue --saves a variable for the dynamic epilogue ending
secretFound
SendFeedbackToggleMute
setAngles
setAnimSpeed
setAutoEquip -- Auto Equip items YES/NO
setAutoSpend -- Auto Spend points YES/NO
setCameraMagnetTarget
setCharSwitchingOn
setCompetitiveCoop
setCoopMode -- Competitive or not
setCurrentAct
setDangerLevel
setDifficultyLevel
setEnable
setEpilogue
setGameFlag("zone", flagID, value) --sets a flag in this zone for the save game
setGameFlag("Heli1", 1, 1 ) --sets the first "heli1" flag to a value of 1
setGameSpeed --Hyperspeed, baby! -Might be what slowed you down during Avalanche fights in XML1
setGameVar
setGoal
setHintType
setHudVisible("TRUE/FALSE") --Turn on/off the HUD.  Useful for 'pretty' screenies.
setHudVisible("FALSE") --turns HUD off
setLaserTarget
setMusicOverride
setNoClip
setNoCollide("entity", "TRUE/FALSE") --sets whether something has collision. Same as setNoClip?
setNoCollide("barrel02", FALSE")
setNoGravity
setNoShadow
setOrigin
setPosX
setPosY
setPosZ
setRecallActive("TRUE/FALSE") --Can you teleport back to headquaters?
setRecallActive("FALSE") --disabled
setRotZ
setScale("name", float ) --Sets the scale of a character, model or effect to whatever value float is.  (Float values can have decimals for those who don"t know)
setScale("hulk", 2.9) --he's HUGE!
setSpecialMode
setStructure
setUnderWater("TRUE/FALSE") --if true, characters will use swimming animations
setUnderwater(1)
setVelocity
spawnInventoryItem("item", "_OWNER_") --spawns an inventory item
startButtonComboChallenge --Shows up in quite a few button challenge sections, but seems to call the combo itself from somewhere else. More research needed
startCutScene("TRUE/FALSE", "TRUE/FALSE" ) --starts a cutscene. All AI and player control is locked during this time, the only things that move are scripted. This may be different if either value is set to true. Testing is needed. Likely the second value allows players to move.
startCutScene("FALSE", "FALSE" )
startGameDiffDialog
startMotionPath
startMovie
startVideoRecord
stopVideoRecord
timerAdd(int) --adds time to a timer.  Can be negative to remove time.
timerStart(number, number, "script")
timerStart(300, 10, "act1/NYC/NYCTimesSquare/timeUp")
titleUpdate() --forces a title update (patch). Xbox 360 only.
unlockHardDifficulty --self explanatory. Usage unknown, but an example is probably in the script for when you defeat Doom
useDefaultStats
useSavedStats
vibrate("ENTITY", vibration type?, min?, max?) --Vibrates the screen controller (if enabled)
vibrate("ENTITY", "RUMBLE", 0.200, 2.200 )
wanderNextZoneLink -- DEBUG?
strcatint('string", integer) --concatenates a string and an int together.
strcatint("blue", 1) --would produce "blue1"
strcatsrt('string", 'string") --concatenates two strings
heroName = GetHeroName("_HERO1_")
strcatstr(heroName, " Rocks")

waitTimed(float) --Force the script to wait for a specified amount of time. 
waitTimed( 0.500 ) --makes the game wait 1/2 second
remove( "entity", "entity" ) --removes an entity. Unknown why it has to be specified twice.
Title: Re: Modding Rundown: PY Scripts
Post by: BLaw on August 30, 2014, 03:33PM
Bump

I was just wondering; did you find anything related or close to a script function allowing you to run a different animation set i.e. from the regular one to the fly animations?
Title: Re: Modding Rundown: PY Scripts
Post by: Teancum on August 30, 2014, 04:56PM
Well, you can force a character to use a power with either loopCombatNode() or setCombatNode(). You can also use playAnim() to play any available animations for that character. As long as it's in their main two animation sets, their fightstyle, their moveset (like flying, if they have one) or the common animations you can use it.

playanim (  "EA_PAIN_HIGH1", "_HERO1_", "NONE", "" )
Title: Re: Modding Rundown: PY Scripts
Post by: BLaw on August 30, 2014, 05:13PM
Was kind of hoping for anything which allows the script to load some other skeleton.
Title: Re: Modding Rundown: PY Scripts
Post by: Teancum on August 31, 2014, 04:40AM
Nope. Nothing that powerful. You could try just adding another animation set inside your PKGB then using playAnim. As near as I've seen Python just needs something to be inside the PKGB, and thus in the memory for that character/level. Not sure if it would work for animations.
Title: Re: Modding Rundown: PY Scripts
Post by: BLaw on August 31, 2014, 12:39PM
Quote from: Teancum on August 31, 2014, 04:40AM
Nope. Nothing that powerful. You could try just adding another animation set inside your PKGB then using playAnim. As near as I've seen Python just needs something to be inside the PKGB, and thus in the memory for that character/level. Not sure if it would work for animations.

I see. Well I don't have a chance to try it out but I sure would love to. The whole 3 animation set thing is really annoying.
Title: Re: Modding Rundown: PY Scripts
Post by: gustavogaraujo on November 12, 2014, 10:38AM
I try to unlock hard and had no effect?Can you help?I put

unlockHardDifficulty() inside scripty/menu/new_game. Its Correct?

Title: Re: Modding Rundown: PY Scripts
Post by: BaconWizard17 on February 09, 2017, 08:10PM
Old topic, but I wanted to make a comment.

The Hulk script in act2/strange doesn't exist in my game files. I've never touched the scripts folder in MUA until today (I've only messed with a few XML2 scripts). I wonder why some would have it and why I don't.
Title: Re: Modding Rundown: PY Scripts
Post by: LarsAlexandersson on February 09, 2017, 09:33PM
Maybe you should download from remastered (include from my RE mod patch), which has most of them including unused Hulk dialogue files
Title: Re: Modding Rundown: PY Scripts
Post by: BaconWizard17 on February 10, 2017, 05:35AM
I'll try to get on that ASAP
Title: Re: Modding Rundown: PY Scripts
Post by: Teancum on July 10, 2019, 09:41AM
Here's a quick dump of all XML1 PY functions

mainMenuExit
openmenu
vibrate
setPartyLightColor
loadDangerRoomCourse
magnetoBall
gameover
lockControls
lockCombat
loadZone
loadMapAddTeam
loadMap
startMovie
addHero("heroname") -- Adds a hero to the currently played roster. Best example of this is when Cyclops joins Wolverine in the first mission. He immediately becomes part of the team. No need to go to an extraction point.
setGroupLeader
removeFromGroup
enemiesNoTarget
heroNoTarget
viewSparringHighScores
restartMission
endDRScenario
restartZone
beginMissionHack
beginMission
saveloadSaveConfirmed
saveloadImageCheck
saveloadDeleteCorrupt
saveloadCompleteLoad
saveloadChooseCorrupt
saveloadDeleteFile
saveloadLoseGameState
saveloadChooseFile
saveloadSelectDevice   
saveloadOvrWriteOptsAsk
saveloadOvrWriteOpts   
saveloadLoadOptions
saveloadOverwrite   
saveloadAbort   
saveloadCleanUp
saveloadFormat 
saveloadDeleteSuccess   
saveloadProcess
controllersContinue
extractionPointChange
extractionPointLite
extractionPoint
endSideMission 
beginSideMission   
immediateObjective 
getObjective   
randomInt   
getInventoryCount   
setInventoryCount   
setInCampaign("charactername", "TRUE") -- Unlocks a given character on the player team
mission
setallaiactive 
missionComplete2   
missionComplete
setDangerLevel 
cinematicEnd   
cinematicStart 
showPopupDialog
canCancelDialog
addPopupDialogOption   
createPopupDialogXmlFilter 
createPopupDialogXml   
createPopupDialog   
displayHelp
display
displayEx   
debug   
blackbirdMenu   
screenFade 
initHud
setGoal
shopMenu   
dangerRoomMenu 
personalItem   
imageViewer
reviewConcept   
reviewComics   
reviewCinematics   
reviewLoadScreens   
triviaMenu 
codexMenu   
cameraResetOldSchool   
cameraSetClipPlane 
overrideFocusToEntity   
cameraToLocationAngles 
cameraToEntityAngles   
cameraFollowMotionPath 
cameraShake
cameraFocusToEntityYaw
cameraFocusToEntity
cameraFade 
cameraReset
cameraFOV   
cameraPan   
cameraMove 
getTimeRemaining   
timerStart 
timerAdd   
enterSoloMode -- Used when a character must go off by themselves without a team
exitSoloMode --  Used to turn off solo mode
soloModeCheck -- Checks to see if soloMode is currently active
zoneLink   
setMissionFlag 
getMissionFlag 
setMissionVar   
getMissionVar   
setGameVar 
getGameVar 
xtremeConversationLight
allowConversation 
disallowResponseOnVar   
startConversation   
spawnEffect
spawnEffectBone
resurrect   
beATeamPlayer   
hailToTheKing 
removeBolton 
addBolton   
setPowerStatus 
setDefaultTarget
setCombatNodeOther 
setCombatNode 
loopCombatNode 
setAIActive
setNearestWaypointPath
setWaypointPath
setEngageEnemy 
setReactToEnemies   
setFlee
setCanMove 
setFollowingHero   
setPatternSequence 
setRadiusConfinement   
moveToEntity   
killEntity 
faceEntity 
destroyMultipartPiece   
addXtremePip   
setHomingID
startMotionPath
setMotionPath   
walkToAndFace   
controlPlayerHeroWithAI
attackEntityWithType 
playanim   
setHintType
getEnable   
setParent   
setInvisible 
setteam
getCount   
setAggression   
setDestroyObjects 
levelUp
getHealth 
getHealthMax
getBody
setOrigin   
setAngles   
setNoCollide   
setInvulnerable
setVelocity
awardXPToPlayable
setXP
restoreHealth
restoreEnergy
setEnable
setNoClip
copyOriginAndAngles
setHealthMax
setHealth
alive
setName
getName
getIDString
getID
setScale
setStructure
getPosZ
getPosY
getPosX
setPosZ
setPosY
setPosX
openmenu codex 
openmenu codex_enemy   
openmenu trivia
openmenu review_loadscreens
openmenu review_cinematics 
openmenu review_comics 
openmenu review_concept
openmenu personal   
openmenu danger_room


openmenu('equip_shop') 
openmenu('item_shop')   
saveloadProcess(4) 
extractionPointChange(%d,0)
extractionPointChange(%d,%i)   
setblackbirdparms FALSE
endSideMission('1')
newgame 1   
saveloadProcess(%d)
saveloadOvrWriteOpts() 
saveloadAbort()
saveloadOvrWriteOptsAsk()   
saveloadLoadOptions()   
saveloadChooseCorrupt()
saveloadChooseFile(%d) 
saveloadLoseGameState(%d)
saveloadDeleteFile(%d)
saveloadOverwrite(%d)
saveloadCompleteLoad()
saveloadCleanUp()   
saveloadDeleteSuccess()
saveloadDeleteCorrupt()
saveloadImageCheck()
Title: Re: Modding Rundown: PY Scripts
Post by: ak2yny on February 07, 2021, 03:50PM
A list of application possibilities for scripts:

Script Files:
Found in the scripts folder. Typically with the py extension.
Can use directly

Conversation Files:
Found in the conversations folder. Typically with the engb extension in MUA.
1) chosenscriptfile = (put script here or script file with path)
    Used after a response and executed with enter.
    A file can be used instead of the script: Eg. act3/valhalla/talk_blackwidow_post
    Multiple scripts are possible, seperate them with "\n\r".
    Example: response {
                    chosenscriptfile = playCombatNodeTrigger("enchantress", "enchantress", "power_smash", 15)\n\rwaittimed(0.1)\n\rplayCombatNodeTrigger("enchantress", "enchantress", "power_smash", 20)
                    (Example from conversations/act3/asgard/asgard1/kiss.engb)
2) conditionscriptfile = (put script here or script file with path)
    Used after start condition
    Same terminology as 1)
    Example: startCondition {
                    conditionscriptfile = common/conv/humantorch ;
               
Map Files:
Found in the map folder. Typically with the engb extension in MUA.
1) actscript = (put script here or script file with path)
    Used in entities with "actonuse = true" term. Executed when used with enter.
    Same terminology as in conversation files (multiple scripts, files possible).
2) spawnscript = (put script here or script file with path)
    Used in entities with rememberent (and possibly other) class. Executed at spawn.
    Same terminology as in conversation files (multiple scripts, files possible).
3) monster_spawnscript = (put script here or script file with path)
    Used in entities with monsterspawnerent class. Executed at spawn.
    Same terminology as in conversation files (multiple scripts, files possible).
4) monster_deathscript = (put script here or script file with path)
    Used in entities with monsterspawnerent class. Executed at death of the NPC.
    Same terminology as in conversation files (multiple scripts, files possible).
               
Menu Files:
Found in the ui/menus folder. Typically with the engb extension in MUA.
usecmd = runscript (put script here)
Unknown if multiple scripts or files are possible.
Some scripts don't need the "runscript" part, eg. "openmenu".
Title: Re: Modding Rundown: PY Scripts
Post by: BaconWizard17 on October 29, 2021, 11:57AM
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.
Title: Re: Modding Rundown: PY Scripts
Post by: 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,

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
Title: Re: Modding Rundown: PY Scripts
Post by: BaconWizard17 on December 05, 2021, 10:23AM
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?
Title: Re: Modding Rundown: PY Scripts
Post by: CCali on December 09, 2021, 02:03AM
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:
Title: Re: Modding Rundown: PY Scripts
Post by: BaconWizard17 on December 10, 2021, 04:19PM
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')
Title: Re: Modding Rundown: PY Scripts
Post by: CCali on December 11, 2021, 02:51PM
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: