Docs/Scripting

From Sunshine Wiki
Jump to navigation Jump to search


Builtin Functions[edit | edit source]

Type Function Description
INT getSystemFlag(int:Sysflag) Gets system flag
VOID setSystemFlag(int:Sysflag, int:Value) Set a value to a system flag
??? getNameRefHandle(str:Actor) Gets actor handle
??? getNameRefName(1var) ???
??? getAddressFromViewObjName(str:Actor) Gets address value from actor
VOID setFlagNPCDontTalk(str:Actor, bool:Flag) Control if an NPC can talk or not
VOID setFlagNPCDontThrow(str:Actor, bool:Flag) Control if an NPC can throw Mario (throwflag in scene params)
VOID setFlagNPCCanTaken(str:Actor, bool:Flag) Control if an NPC can be picked up
VOID setFlagNPCDead(str:Actor, bool:Flag) Hides NPC/enemy
VOID setCollision(str:Actor, bool:Flag) Control if an NPC/enemy's hitbox is detectable
BOOL isNpcSinkBottom(int:Address) Checks if an NPC is sunken in goop
VOID setNpcTalkForbidCount(str:Actor, int:Timing) Forbid talking to an NPC for an amount of time
VOID npcDanceOn(int:Address) Makes NPC dance
VOID npcDanceOffHappyOn(int:Address) Puts NPC in "Happy" mode
BOOL isNearActors(str:Actor, flt:Distance, ...str:Actor(s)) Checks if an object is near another
??? isNearSameActors(3var) ???
BOOL isOnLiveActorFlag(str:Actor, bool:Flag) Checks if actor is alive or dead
VOID setHide4LiveActor(str:Actor, bool:Flag) Hides actor
VOID setDead4LiveActor(str:Actor, bool:Flag) Deactivates actor
BOOL isGameModeNormal() Checks if the gameplay is normal (Mario can move etc.)
BOOL isDemoMode() Checks if the game is in cutscene mode
BOOL isTalkModeNow() Checks if Mario is talking to someone
VOID maniCoinFallDown() Drops HUD totals to be visible
VOID appearReadyGo() Triggers "GO!"
VOID? launchEventClearDemo() Triggers "SHINE GET!"
VOID appear8RedCoinsAndTimer() Spawn hidden red coins and insert timer (for redcoinswitch)
VOID startAppearJetBalloon(int:Type, bool:Flag) Insert counter
  • 0=Balloon
  • 1=Pianta
  • 2=Red Coin
VOID insertTimer(int:Mode, int:Time) Insert timer on-screen
  • 0=Despawn
  • 1=Count up
  • 2=Count down
VOID startTimer(int:Time) Start the timer (time is when "hurry up!" begins)
VOID stopTimer() Stops the timer
INT getTime() Gets the amount of time on the timer
VOID warpMario(flt:X, flt:Y, flt:Z, flt:Yaw) Warp Mario to a position
VOID warpFrontToMario(int:Address) Warp object to the front of Mario
VOID changeNozzle(int:Type) Change Mario's nozzle state
  • 0=Spray
  • 1=Rocket
  • 2=Underwater
  • 3=Resting Spray
  • 4=Hover
  • 5=Turbo
  • 6=CRASH?
  • 7=Diver Helmet
VOID changeSunglass(int:State) Enable/disable sunglasses
??? onNeutralMarioKey() ???
VOID invalidatePad(int:Timing) Deactivate Gamepad input for an amount of time
VOID startMareBottleDemo() Starts the cutscene for Mario shrinking into a bottle
BOOL isFinishMareBottleDemo() Checks if the bottle cutscene has finished
??? startMarioTalking() ???
??? setMarioWaiting() ???
??? getNPCType(1var) ???
??? getTalkNPC() ???
STR getTalkNPCName() Gets NPC handle for when talking to
VOID setTalkMsgID(int:???, int:???) ???
INT? getTalkMode() Gets the current talk mode
??? getTalkSelectedValue() ???
??? setValue2TalkVariable(2var) ???
BOOL isEMarioReachedToGoal(1var) Checks if EMario has finished his pad file?
BOOL isEMarioDownWaitingToTalk(str:EMario) Checks if EMario is on the ground waiting
VOID startEMarioRunAway(str:EMario) EMario gets up and runs away
VOID startEMarioGateDrawing(str:EMario) Starts Shadow Mario painting cutscene
VOID startEMarioDisappear(str:EMario) Makes EMario disappear
VOID startOpenModelGate(str:Gate) Trigger 'gate' model to appear
VOID startMonteman(int:Pad) Chooses the .pad file for Piantissimo to use
??? monteManReachFlag() ???
VOID setNextStage(int:StageID, int:SceneID) Warps to a new scene
VOID registerMovie(int:MovieID) Starts THP cutscene
VOID startBGM(int:BgmID) Plays BGM (IDs listed in mSound.asn)
VOID stopBGM(int:BgmID) Stops playing BGM (IDs listed in mSound.asn)
VOID startSE(int:SeID) Plays sound effect (IDs listed in mSound.asn)
VOID startEventSE(int:SeID) Plays "event" sound effect (coin deduction sounds)
  • 0=single
  • 1=multiple
VOID startMontemanBGM() Starts race music (added in USA)
VOID startMontemanFanfare() Plays race finish fanfare (added in USA)
VOID startMiss() Kill Mario
??? gameOver() ???
VOID killMushroom1up(str:1Up) Hides 1-Up
VOID appearMushroom1up(str:1Up) Spawns 1-Up
VOID killShine(str:Shine) Hides Shine Sprite
VOID appearShine(str:Shine, str:Camera) Spawn Shine Sprite
VOID appearShineFromNPC(str:Shine, str:Actor, str:Camera) Spawn Shine from object
VOID appearShineFromNPCWithoutDemo(str:Shine, str:Actor) Spawn Shine from object without demo
VOID appearShineFromKageMario(str:Shine, str:Actor, flt:YHeight) Spawn Shine from object's position
VOID appearShineForWoodBox(1var) ???
VOID setEventID(str:Shine, int:ID) Update Shine Sprite ID
??? __forceStartTalk(str:Actor) Forces Mario to talk to an NPC
??? __forceStartTalkExceptNpc(str:Actor) Forces Mario to talk to something even if it isn't an NPC
VOID forceCloseTalk() ???
VOID connectDummyNpc(str:Actor) Connects DUMMY NPC to an object
VOID? onTalkToDummyNpc() Enables talking to DUMMY NPC like a regular NPC
VOID setNpcBalloonMessage(str:Actor, int:MsgID, int:Timing) Trigger a FLUDD message after an amount of time
BOOL isInsideCube(int:Num) Checks if Mario is inside a "room cube". 'Num' is the index of the cube in the table
BOOL isInsideFastCube(int:Table, int:Num) Checks if Mario is inside a "high speed cube"
VOID setTransScale(str:Actor, flt:X, flt:Y, flt:Z, flt:ScaleX, flt:ScaleY, flt:ScaleZ) Control transformation of an object (position and scale)
INT getPollutionLevel() Gets amount of pollution
BOOL isGraffitoCoverage0() ???
??? setPollutionIncreaseCount(1var) ???
??? setGraffitoMultiplied(1var) ???
VOID setEventForWaterMelon(1var) ???
BOOL isWaterMelonIsReached(1var) ???
??? checkWoodBox(2var) ???
VOID refreshWoodBox(int:StartBox, int:EndBox) Respawns broken boxes with "ゲーム木箱"
VOID killWoodBox(int:StartBox, int:EndBox) Kills boxes with "ゲーム木箱"
VOID? resetFruitNum(int:BasketAddress) Resets the number of fruit put into a basket
INT getFruitNum(2var) ???
VOID setFruitType(int:BasketAddress, int:Type , int:???) ???
VOID eggYoshiStartFruit(1var) ???
VOID putNozzle(1var) ???
VOID fireStartDemoCamera(str:Camera) Starts camera demo. (CameraMapTool or map/camera/.bck)
??? checkMonteClear(int:Num) Check if a Pianta isn't dirty
??? setTimeLimit(1var) ???
??? getRestTime() ???
??? setAttentionTime(1var) ???
BOOL isBossDefeated() ???
BOOL isMapEventFinishedAll(str:Event) Checks if the map event is finished
??? raiseBuilding(1var) ???
??? pushNerve4LiveActor(2var) ???
??? checkCurNerve4Npc(2var) ???
??? checkLatestNerve4Npc(2var) ???
??? pushNerve(1var) ???
??? setAnmRate(2var) ???
??? setBck(1var) ???
??? setBpk(1var) ???
??? setBtp(1var) ???
??? setBtk(1var) ???
??? setBlk(1var) ???
??? setBls(1var) ???
??? setSRT(3var) ???
??? getSRT(2var) ???
yield
exit
lock
unlock
print(...) Prints content to a logger
dump
int
float
typeof