6 registered members (AndrewAMD, rki, Mino, Martin_HH, squik, Ayumi),
1,126
guests, and 7
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: detect when player is in a specific room?
[Re: Doriel]
#146918
08/09/07 14:49
08/09/07 14:49
|
Joined: Mar 2006
Posts: 752 Portugal
demiGod
User
|
User
Joined: Mar 2006
Posts: 752
Portugal
|
Several ways. One could be triggers, put a dummy object in the entrance / door of the room and assign an action / function to trigger the event when the player touches the objec. Ex: Code:
function my_event { if ( EVENT_TYPE == EVENT_ENTITY )&&( you == room1) { my._roomPos = 1; // other functions } }
In player action put: my.enable_entity = on; my.event = my_event; In rooms dummy action: my.passable = on; my.enable_entity = on;
|
|
|
Re: detect when player is in a specific room?
[Re: Doriel]
#146920
08/09/07 18:31
08/09/07 18:31
|
Joined: Aug 2005
Posts: 1,558 HK
vlau
Serious User
|
Serious User
Joined: Aug 2005
Posts: 1,558
HK
|
You need to c_move your player in order to trigger events. Maybe try : Code:
if (vec_dist(player.x,specific_room.x) < boundary) { // do something when player inside the room } else { // do somthing when player outside the room }
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|