Skip to Content
The Alchemy Project

src/field/script_commands_messages.c

Messages shown at an actor, and the speaker's voice. More…

Included by script_commands.c.

Macros

NameDescription
#defineMESSAGE_VOICE_NONE 0x80000000fdMessageSetVoiceFromActor's key for no voice: it clears the voice.
#defineMESSAGE_POSITION_WIDTH 320fdScriptShowSpeakerMessage and fdScriptShowMessageAtPos move a position MESSAGE_POSITION_SHIFT away from the middle row of a MESSAGE_POSITION_WIDTH by MESSAGE_POSITION_HEIGHT area, larger than the 240 by 160 screen, and hold it MESSAGE_POSITION_MARGIN_X and MESSAGE_POSITION_MARGIN_Y inside the area.
#defineMESSAGE_POSITION_HEIGHT 240
#defineMESSAGE_POSITION_MARGIN_X 8
#defineMESSAGE_POSITION_MARGIN_Y 20
#defineMESSAGE_POSITION_SHIFT 32

Functions

NameDescription
Sint32fdMessageShowAtActor (Sint32 speaker, Sint32 unused)The script command "open message": opens the script's current message in a speech window next to the speaking actor, with the speaker's portrait beside it when it has one, and moves on to the next message.
voidfdMessageShowAtActorAndWait (Sint32 speaker, Sint32 flags)Opens the script's current message at the speaker and waits for its window; after ten seconds, or with Select, R, L and A held, the text is finished at once.
voidfdScriptShowMessageThenWait (Sint32 speaker, Sint32 flags, Sint32 ticks)The script command "show message and wait": shows the message, then waits the given number of ticks.
voidfdScriptShowMessageAndWait (Sint32 speaker, Sint32 flags)The script command "show message": opens the current message at the speaker (fdMessageShowAtActor) and waits until it has been read and its window has closed; the speaker's portrait is closed once the text is typed out.
Sint32fdScriptAskYesNoAndShowResponse (Sint32 speaker, Sint32 flags)The script command "ask yes or no": opens the question at the speaker, lets the leader answer, then shows the next message for yes or the one after it for no.
voidfdScriptNoOperationUpdate (void)An empty hook; it does nothing in the released game.
voidfdScriptShowSpeakerMessage (Sint32 speaker)Unused: nothing calls it.
voidfdScriptForwardShowMessageAtPos (Sint32 unusedA, Sint32 unusedB, Sint32 x, Sint32 y)Unused: nothing calls it; forwards its arguments to fdScriptShowMessageAtPos.
voidfdScriptShowMessageAtPos (Sint32 unusedA, Sint32 unusedB, Sint32 x, Sint32 y)Unused: nothing calls it.
voidfdActorClosePortrait (Sint32 actorId)Closes the portrait of an actor's sprite, if it has one.
voidfdScriptShowTwoMessagesAndWait (Sint32 first, Sint32 firstX, Sint32 firstY, Sint32 firstPortraitX, Sint32 firstPortraitY, Sint32 second, Sint32 secondX, Sint32 secondY, Sint32 secondPortraitX, Sint32 secondPortraitY, Sint32 delay)The script command "show two messages and wait": two actors speak at once, each message at its own (x, y) with its portrait at (portraitX, portraitY), all in tiles.
voidfdMessageSetVoiceFromActor (Sint32 key)Sets the voice of the messages that follow to that of actor key's sprite, at the rate the message speed option picks (MessageSpeedVoiceRates); MESSAGE_VOICE_NONE clears it.
voidfdCameraFollowActor (Sint32 actorId, Sint32 keepPos)The script command "camera follow actor": the camera follows the actor, put on it at once unless keepPos leaves it where it is to set out from.
voidfdCameraSetSpeedParams (FIXED speed, FIXED acceleration)The script command "camera set speed": the camera's top speed and acceleration, 16.16 pixels per tick.

Variables

NameDescription
extern const Uint8MessageSpeedVoiceRates []The countdown between the sounds of a message's voice as it types, by the message speed the player chose (fdMessageSetVoiceFromActor).

Description

Messages shown at an actor, and the speaker's voice. Part of script_commands.c.

Macros in detail

MESSAGE_VOICE_NONE

#define MESSAGE_VOICE_NONE 0x80000000

fdMessageSetVoiceFromActor's key for no voice: it clears the voice.

Referenced by fdMessageSetVoiceFromActor() and fdMessageShowAtActorAndWait().

Definition at line 9 of file script_commands_messages.c.

MESSAGE_POSITION_WIDTH

#define MESSAGE_POSITION_WIDTH 320

fdScriptShowSpeakerMessage and fdScriptShowMessageAtPos move a position MESSAGE_POSITION_SHIFT away from the middle row of a MESSAGE_POSITION_WIDTH by MESSAGE_POSITION_HEIGHT area, larger than the 240 by 160 screen, and hold it MESSAGE_POSITION_MARGIN_X and MESSAGE_POSITION_MARGIN_Y inside the area.

Referenced by fdScriptShowMessageAtPos() and fdScriptShowSpeakerMessage().

Definition at line 318 of file script_commands_messages.c.

MESSAGE_POSITION_HEIGHT

#define MESSAGE_POSITION_HEIGHT 240

Referenced by fdScriptShowMessageAtPos() and fdScriptShowSpeakerMessage().

Definition at line 319 of file script_commands_messages.c.

MESSAGE_POSITION_MARGIN_X

#define MESSAGE_POSITION_MARGIN_X 8

Referenced by fdScriptShowMessageAtPos() and fdScriptShowSpeakerMessage().

Definition at line 320 of file script_commands_messages.c.

MESSAGE_POSITION_MARGIN_Y

#define MESSAGE_POSITION_MARGIN_Y 20

Referenced by fdScriptShowMessageAtPos() and fdScriptShowSpeakerMessage().

Definition at line 321 of file script_commands_messages.c.

MESSAGE_POSITION_SHIFT

#define MESSAGE_POSITION_SHIFT 32

Referenced by fdScriptShowMessageAtPos() and fdScriptShowSpeakerMessage().

Definition at line 322 of file script_commands_messages.c.

Functions in detail

fdMessageShowAtActor

Sint32 fdMessageShowAtActor(Sint32 speaker, Sint32 unused)

The script command "open message": opens the script's current message in a speech window next to the speaking actor, with the speaker's portrait beside it when it has one, and moves on to the next message.

References fdActorGetScreenPos(), fdActorGetSpriteById(), fdActorLookup(), fdPartyGetLeaderActor(), fdSpeakerGetVoice(), mnMessageAllTypedStub(), mnMessageOpenWindowStub(), mnPortraitGetForSpeakerStub(), mnPortraitOpenWindowStub(), mnTextGetMessageSizeAllPagesStub(), mnTextGetMessageSizeStub(), Sint32, syConvert3Dto2D() and sySynch().

Referenced by dbShopTestTalkToSunshine(), dbShopTestTalkToSunshinesWife(), fdMessageShowAtActorAndWait(), fdScriptAskYesNoAndShowResponse(), fdScriptOpenMessage(), scAlhafraAskWhetherIndraMoved(), scAlhafraBackloggedWithCanoes(), scAlhafraFatherLetsPartyToCave(), scAlhafraManorAskAboutAlhafra(), scAlhafraManorAskIfTheHeroes(), scAlhafraManorBriggsEscapes(), scAlhafraManorPointOutAirsRock(), scAlhafraManorTellOfTheEasternSea(), scAlhafraMayorInAMeeting(), scAlhafraTalkToHungryBoy(), scAncientLemuriaMeetTheLemurians(), scAttekaInletAskKradenToSetSail(), scAttekaInletKradenAsksToSetSail(), scChampaCliffCavesAskToComeIn(), scChampaCliffCavesObabaAsksForBriggs(), scChampaCliffCavesObabaForgesTrident(), scChampaCliffCavesObabaMournsSalamander(), scChampaCliffCavesObabaSeesAWeapon(), scChampaMessageOpen(), scContigoOfferLuckyDice(), scContigoOfferLuckyWheels(), scContigoOfferSuperLuckyDice(), scContigoReturnToNewHome(), scContigoTheReunion(), scDailaMeetAlex(), scDailaRoomsAskGoingToMadra(), scDailaRoomsAskLookingForBoat(), scDailaRoomsTalkToHealer(), scDailaTalkBeenBefore(), scDailaTalkBoat(), scDailaTalkHip(), scDailaTalkIndraMoved(), scGabombaStatueChamberAkafubuOffersToHelp(), scGabombaStatueChamberGabombaNamesWitchDoctor(), scGabombaStatueChamberWhereIsTheOrb(), scGarohRoomsAskAboutReveal(), scGarohRoomsAskWhatTheWanderersSeek(), scGarohRoomsTalkToItemShopkeeper(), scGarohWerewolvesRevealThemselves(), scIzumoOfferATokenOfGratitude(), scIzumoRoomsAskAboutMtMikage(), scIzumoStopThePartyToThankThem(), scIzumoTalkToFestivalStoneCircleGuard(), scIzumoTalkToStoneCircleGuard(), scIzumoTellOfUzumesFamily() and 7 more.

Definition at line 14 of file script_commands_messages.c.

fdMessageShowAtActorAndWait

void fdMessageShowAtActorAndWait(Sint32 speaker, Sint32 flags)

Opens the script's current message at the speaker and waits for its window; after ten seconds, or with Select, R, L and A held, the text is finished at once.

References fdActorGetSpriteById(), fdFindActorPlacement(), fdMessageSetVoiceFromActor(), fdMessageShowAtActor(), mnMessageCloseFinishedWindowsStub(), mnPortraitCloseWindowStub(), mnWindowIsClosedStub(), PerWork, Sint32 and sySynch().

Referenced by fdScriptAskYesNoAndShowResponse(), fdScriptShowMessageAndWait() and fdScriptShowMessageThenWait().

Definition at line 235 of file script_commands_messages.c.

fdScriptShowMessageThenWait

void fdScriptShowMessageThenWait(Sint32 speaker, Sint32 flags, Sint32 ticks)

The script command "show message and wait": shows the message, then waits the given number of ticks.

References fdMessageShowAtActorAndWait(), fdScriptWait() and Sint32.

Referenced by scAlhafraGiveBreadToHungryBoy(), scAlhafraMadransArrive(), scAlhafraManorBriggsEscapes(), scAlhafraManorComplainAboutTheMayor(), scAlhafraManorDefendTheMayor(), scAlhafraManorTellOfTheEasternSea(), scAlhafraPirateSeesMadrasMayor(), scAlhafraTalkToHungryBoy(), scAncientLemuriaHeadForTheDock(), scAncientLemuriaMeetTheLemurians(), scChampaCliffCavesAskIfBriggsLearned(), scChampaCliffCavesObabaAsksForSecondPiece(), scChampaCliffCavesObabaForgesTrident(), scChampaCliffCavesObabaMournsSalamander(), scChampaCliffCavesObabaSeesAWeapon(), scContigoTheReunion(), scEasternAlhafraShipBriggsIsCaught(), scEasternAlhafraShipEoleoLifts(), scEasternAlhafraShipMayorArrives(), scFieldScriptShowMessageThenWait(), scGabombaStatueChamberGabombaNamesWitchDoctor(), scGarohRoomsWakeAtInn(), scIdejimaCatchUpWithFelix(), scIdejimaWakeSheba(), scKandoreanTempleMeetPoi(), scKandoreanTempleTestTheStudents(), scKibomboAkafubuOffersCrystal(), scKibomboDeadEndByTheStatue(), scKibomboGabombaResponds(), scKibomboGabombaRespondsToGift(), scKibomboPiersTakesPartyForEnemies(), scKibomboPresentJewelToGabomba(), scKibomboTalkForeignCeremony(), scLemuriaPalaceMeetKingHydros(), scLemuriaRoomsMeetLunpa(), scLemuriaRoomsPiersVisitsUncle(), scMadraDrawbridgeAskGoingToOsenia(), scMadraDrawbridgeBlockBridge(), scMadraGrantPassageToOsenia(), scMadraInspectPartyAtGate(), scMadraKarstAsksAboutMenardi(), scMadraKarstCallsForMenardi(), scMadraKarstSendsPartyAway(), scMadraMeetKarst(), scMadraMindReadKarst(), scMadraStopPartyAfterRaid(), scShrineOfTheSeaGodLashRope(), scShrineOfTheSeaGodStartleRiki(), scSuhallaGateAfterPunchAntBattle(), scSuhallaGatePointToMeetingSpot() and 1 more.

Definition at line 273 of file script_commands_messages.c.

fdScriptShowMessageAndWait

void fdScriptShowMessageAndWait(Sint32 speaker, Sint32 flags)

The script command "show message": opens the current message at the speaker (fdMessageShowAtActor) and waits until it has been read and its window has closed; the speaker's portrait is closed once the text is typed out.

References fdMessageShowAtActorAndWait() and Sint32.

Referenced by dbIncreaseItemAndLevelShowCharacterName(), dbIncreaseItemAndLevelShowName(), dbShopTestTalkToSunshine(), dbShopTestTalkToSunshinesWife(), fdRunPsynergyScript(), fdScriptRunMessage(), fdScriptShowMessage(), fdUseItem(), scAirsRockInsideReadRevealTablet(), scAlhafraAskWhetherIndraMoved(), scAlhafraBackloggedWithCanoes(), scAlhafraFatherLetsPartyToCave(), scAlhafraManorAskAboutAlhafra(), scAlhafraManorAskIfTheHeroes(), scAlhafraManorPointOutAirsRock(), scAlhafraMayorInAMeeting(), scAlhafraRoomsTalkToInnkeeper(), scAlhafraRoomsTalkToItemMerchant(), scAlhafraRoomsTalkToPriest(), scAlhafraTalkToHungryBoy(), scAttekaInletAskKradenToSetSail(), scAttekaInletHammaShowsTheWings(), scAttekaInletHammetsMessengerArrives(), scAttekaInletKradenAsksToSetSail(), scAttekaInletShipwrightsStopTheParty(), scChampaCliffCavesAskToComeIn(), scChampaCliffCavesObabaAsksForBriggs(), scChampaCliffCavesObabaOffersHelp(), scChampaCliffCavesSailorSurrenders(), scChampaCliffCavesSailorTurnsAway(), scContigoBabyThinks(), scContigoInitLuckyDice(), scContigoOfferLuckyDice(), scContigoOfferLuckyWheels(), scContigoOfferSuperLuckyDice(), scContigoReportCoinChange(), scContigoReturnToNewHome(), scContigoTalkAboutTheShip(), scContigoTalkToArmorMerchant(), scContigoTalkToDoubtingBoy(), scContigoTalkToHealer(), scContigoTalkToInnkeeper(), scContigoTalkToItemMerchant(), scContigoTalkToWeaponMerchant(), scContigoTheReunion(), scDailaAskAfterTaviAndRiki(), scDailaMeetAlex(), scDailaRoomsAskGoingToMadra(), scDailaRoomsAskLookingForBoat(), scDailaRoomsPracticeShout() and 99 more.

Definition at line 282 of file script_commands_messages.c.

fdScriptAskYesNoAndShowResponse

Sint32 fdScriptAskYesNoAndShowResponse(Sint32 speaker, Sint32 flags)

The script command "ask yes or no": opens the question at the speaker, lets the leader answer, then shows the next message for yes or the one after it for no.

References fdMessageShowAtActor(), fdMessageShowAtActorAndWait(), fdPartyGetLeaderActor(), fdScriptAskYesNoWithActorAnimation(), result and Sint32.

Referenced by fdScriptAskYesNo(), scContigoAskAboutGeoglyph(), scContigoAskAboutSuperDice(), scContigoAskAboutWindLegend(), scKandoreanTempleAskAboutPoi(), scKandoreanTempleAskWhoPassedTheTest(), scKibomboAskAboutFewerWarriors(), scKibomboAskAboutRevenge() and scKibomboAskGoingWest().

Definition at line 290 of file script_commands_messages.c.

fdScriptNoOperationUpdate

void fdScriptNoOperationUpdate(void)

An empty hook; it does nothing in the released game.

Definition at line 310 of file script_commands_messages.c.

fdScriptShowSpeakerMessage

void fdScriptShowSpeakerMessage(Sint32 speaker)

Unused: nothing calls it. It would record the speaker, open the message near it and wait unless fast-forwarding, then advance the message index. It places the message as fdScriptShowMessageAtPos does, before passing the position to a window function that takes tiles; with no caller, the units it expected can't be told.

References fdActorLookup(), mnMessageOpenWindowStub(), mnWindowIsClosedStub(), Sint32 and sySynch().

Definition at line 329 of file script_commands_messages.c.

fdScriptForwardShowMessageAtPos

void fdScriptForwardShowMessageAtPos(Sint32 unusedA, Sint32 unusedB, Sint32 x, Sint32 y)

Unused: nothing calls it; forwards its arguments to fdScriptShowMessageAtPos.

References fdScriptShowMessageAtPos() and Sint32.

Definition at line 372 of file script_commands_messages.c.

fdScriptShowMessageAtPos

void fdScriptShowMessageAtPos(Sint32 unusedA, Sint32 unusedB, Sint32 x, Sint32 y)

Unused: nothing calls it. It would open the script's message at (x, y), wait for it and advance the message index; its units are as unknown as fdScriptShowSpeakerMessage's.

References mnMessageOpenWindowStub(), mnWindowIsClosedStub(), Sint32 and sySynch().

Referenced by fdScriptForwardShowMessageAtPos().

Definition at line 383 of file script_commands_messages.c.

fdActorClosePortrait

void fdActorClosePortrait(Sint32 actorId)

Closes the portrait of an actor's sprite, if it has one.

References fdActorGetSpriteById(), mnPortraitCloseWindowStub() and Sint32.

Definition at line 414 of file script_commands_messages.c.

fdScriptShowTwoMessagesAndWait

void fdScriptShowTwoMessagesAndWait(Sint32 first, Sint32 firstX, Sint32 firstY, Sint32 firstPortraitX, Sint32 firstPortraitY, Sint32 second, Sint32 secondX, Sint32 secondY, Sint32 secondPortraitX, Sint32 secondPortraitY, Sint32 delay)

The script command "show two messages and wait": two actors speak at once, each message at its own (x, y) with its portrait at (portraitX, portraitY), all in tiles. When delay is nonzero, the second message waits for the first to finish, checking every delay ticks. Waits for A, B, L or R, then closes both.

References fdActorGetSpriteById(), fdSpeakerGetVoice(), mnMessageAllTypedStub(), mnMessageCloseFinishedWindowsStub(), mnMessageOpenWindowStub(), mnPortraitCloseWindowStub(), mnPortraitOpenWindowStub(), mnWindowIsClosedStub(), PerWork, Sint32 and sySynch().

Referenced by scFieldScriptShowTwoMessagesAndWait().

Definition at line 428 of file script_commands_messages.c.

fdMessageSetVoiceFromActor

void fdMessageSetVoiceFromActor(Sint32 key)

Sets the voice of the messages that follow to that of actor key's sprite, at the rate the message speed option picks (MessageSpeedVoiceRates); MESSAGE_VOICE_NONE clears it.

References fdActorGetSpriteById(), fdSpeakerGetVoice(), MainRoutineStateWork, MessageSpeedVoiceRates and Sint32.

Referenced by fdMessageShowAtActorAndWait().

Definition at line 491 of file script_commands_messages.c.

fdCameraFollowActor

void fdCameraFollowActor(Sint32 actorId, Sint32 keepPos)

The script command "camera follow actor": the camera follows the actor, put on it at once unless keepPos leaves it where it is to set out from.

References fdActorLookup(), fdActorStartCameraStub(), fdMapGridCenterOnFollowedPointStub(), Sint32 and sySynch().

Referenced by fdActorDescendInWhirlwind(), fdEntrancePlayArrival(), fdPsynergyEndSand(), fdPsynergySand(), fdScriptEnd(), fdViewMoveEnd(), scAirsRockInsideRideWhirlwind(), scAirsRockInsideWakeEntranceStatue(), scAirsRockInsideWakeHallStatue(), scAlhafraMadransArrive(), scAlhafraManorBriggsEscapes(), scAncientLemuriaMeetTheLemurians(), scCavernsPlaceAngaraBlocks(), scChampaCliffCavesAskIfBriggsLearned(), scContigoInitVillage(), scEasternAlhafraShipBriggsIsCaught(), scGondowanCliffsHideoutWarriorsAreFound(), scInit(), scIzumoFinishMovingStone(), scLemurianShipParchHold(), scLemurianShipSetUpHold(), scLemuriaPalaceMeetKingHydros(), scMadraMeetKarst(), scScriptCameraFollowActor(), scShamanVillageStepBackFromTrial(), scSuhallaGatePunchAntJumpsOut(), scSuhallaGatePunchAntJumpsOutAsLeaderStepsAside(), scTundariaTowerSlidePillar() and scYampiDesertWatchScorpionStop().

Definition at line 513 of file script_commands_messages.c.

fdCameraSetSpeedParams

void fdCameraSetSpeedParams(FIXED speed, FIXED acceleration)

The script command "camera set speed": the camera's top speed and acceleration, 16.16 pixels per tick.

References syHeapSlotAllocateEWRAM().

Referenced by fdCameraSetSpeedFX(), scAirsRockInsideShebaLearnsReveal(), scAirsRockInsideWakeEntranceStatue() and scAirsRockInsideWakeHallStatue().

Definition at line 541 of file script_commands_messages.c.