Setting Screen Entry Points: Difference between revisions
No edit summary |
No edit summary |
||
Line 18: | Line 18: | ||
To make an actor chase Ego from one room to the next and appear in this same position, use a global variable, then depending on if the variable is set to true or false init the following character in the particular rooms otherwise simply don't init the character. | To make an actor chase Ego from one room to the next and appear in this same position, use a global variable, then depending on if the variable is set to true or false init the following character in the particular rooms otherwise simply don't init the character. | ||
==<br /> References == | |||
<references /> | |||
==<br /> Related Links == | |||
* | |||
| | ||
[[Category:Actors]] | [[Category:Actors]] | ||
[[Category:SCI Actors]] | [[Category:SCI Actors]] | ||
[[Category:Control Areas]] | [[Category:Control Areas]] |
Revision as of 18:11, 28 April 2025
By Cloudee1
When moving Ego from one room to another, if you want the last position reflected you will need to use it as the variable.
For instance this code is directly from one of my games. room 500 is the inventory screen, and when you return from it you need to be in the exact spot that you left. room 3 is adjacent to the room so some variables need to stay the same like the egos y position and loop, but not all of them as you see I manually set the x. Anyway, hope this little snippet helps clear up your question.
(switch(gPreviousRoomNumber)
(case 500 (send gEgo:view((send gEgo:view))loop((send gEgo:loop))posn((send gEgo:x) (send gEgo:y))init()))
(case 3 (send gEgo:view((send gEgo:view))loop((send gEgo:loop))posn(45 (send gEgo:y))init()))
(default(send gEgo:view((send gEgo:view))posn(170 130)loop(2)init()))
) // end switch
To make an actor chase Ego from one room to the next and appear in this same position, use a global variable, then depending on if the variable is set to true or false init the following character in the particular rooms otherwise simply don't init the character.
References
Related Links