Modding Rundown: PY Scripts

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

Previous topic - Next topic
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?

Yes, exactly.
Why? something wrong?

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.

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)
Please search the forum before asking a question. I dont answer
PMs about modding, those questions should be posted in a public thread.
What im currently working on: http://marvelmods.com/forum/index.php?topic=2275.0
My mods are mine to booster/update, I will not give anybody permission to do it

Yeah, I've tried it.  Trouble is the skinsets are defined differently in MUA.

oh ok
Please search the forum before asking a question. I dont answer
PMs about modding, those questions should be posted in a public thread.
What im currently working on: http://marvelmods.com/forum/index.php?topic=2275.0
My mods are mine to booster/update, I will not give anybody permission to do it

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...


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.

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.

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...


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!

July 29, 2008, 06:07AM #27 Last Edit: April 23, 2011, 01:23PM by Gevth
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"


I alphabetized the list.  Hopefully that will help folks find functions faster.

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 )