Events
These events are on PhoneLines, which is described on Phones and calls.
Things to know
Ringingfires when the game accepts a ring, right after the ring is set. It fires for rings from yourRingcall and for rings the game starts itself.Numberis the digits of the caller. It fires while the game is still ringing the phone, so keep your handler short. (It is raised inside the game’sReceiveCall, after the ring is set.)CallStartedfires when a call starts on a phone. That includes calls the player makes on the dial pad and calls answered from a ring. (It is raised fromPhone.OnCallStarted. Dial-pad calls reachStartCallthroughPhoneUI.StartCallDelay.)CallEndedfires when the same call ends.Numberis the digits of the number the game used to start the call. For a call the player dialled, the game may have picked a message entry instead (for example “not reachable”, “not answering” or “outside the network”), and thenNumberis that entry’s number. (It is raised fromPhone.OnCallEnded.Numberis the digits of thePhoneNumberthe game passed toStartCall.)- The framework keeps the number of the current call until the game ends it. If the game ends a call another way, the number stays until the next
StartCall. (It is cleared inPhone.OnCallEnded.) IsAvailableisfalsewhen the phone events could not be set up. See “If something fails to set up” in Details.
Limits
- A refused ring raises nothing, and nothing is raised while a save is loading or saving.
- A ring that comes back from a save raises no
Ringing. The game does not call its ring method when a save loads. (The only caller ofReceiveCallisPhonecallRelay, so a load does not call it.) - A call that
StartCallset up and the game then turned down raises nothing. CallStartedandCallEndedare not stopped while a save is loading. If your handler should ignore events raised while a save loads, checkSaveData.Busy(true while a save is loading or being written).