Jump to content


Photo

How To Send Object A Specific Place(Another Room)


  • Please log in to reply
3 replies to this topic

#1 sani35

sani35

    GMC Member

  • GMC Member
  • 50 posts
  • Version:GM:Studio

Posted 05 December 2013 - 03:48 PM

how can i send my object to a specific place in another room.i mean i dont want that my object stuck in another object.

for ex:

if i have room map and room market and i try to get to room market from room map my obh_character may overlap with obj_market or something else.

i tried createing an obj_spawn and use its obj_spawn.x obj_spawn.y points but it didnt worked 

i think its because my objects persistent is on.

so any help ??


  • 0

#2 CrazyGuyGames

CrazyGuyGames

    YYGF Member

  • GMC Member
  • 583 posts
  • Version:GM:Studio

Posted 05 December 2013 - 03:52 PM

You can't send another object to another room, if you make them persistent that object will remain no matter what happens.

What you could do is create a variable lets say.

global.object_x_exists = 0

Then somewhere set it to 1.

And a control object should create that object if the variable is equal to 1.

if global.object_x_exists = 1 instance_create(x,y,obj_your_object)


  • 0

#3 sani35

sani35

    GMC Member

  • GMC Member
  • 50 posts
  • Version:GM:Studio

Posted 05 December 2013 - 04:27 PM

You can't send another object to another room, if you make them persistent that object will remain no matter what happens.

What you could do is create a variable lets say.

global.object_x_exists = 0

Then somewhere set it to 1.

And a control object should create that object if the variable is equal to 1.

if global.object_x_exists = 1 instance_create(x,y,obj_your_object)

so if i dont use persistent its more logical ? i mean if i set a control object and make it persistant than i use that instance_create code in every event like 

collison enemy

room_goto blabla

instance create .....

?


  • 0

#4 CrazyGuyGames

CrazyGuyGames

    YYGF Member

  • GMC Member
  • 583 posts
  • Version:GM:Studio

Posted 06 December 2013 - 02:14 AM

 

You can't send another object to another room, if you make them persistent that object will remain no matter what happens.

What you could do is create a variable lets say.

global.object_x_exists = 0

Then somewhere set it to 1.

And a control object should create that object if the variable is equal to 1.

if global.object_x_exists = 1 instance_create(x,y,obj_your_object)

so if i dont use persistent its more logical ? i mean if i set a control object and make it persistant than i use that instance_create code in every event like 

collison enemy

room_goto blabla

instance create .....

?

 

Em... not exactly, I mean just put your player in every room and don't make it persistent :P, or if it is persistent you will need to set the x and y of the player to specific locations.

e.g.

Room start event:

If room = room_level1

{x = 100 y = 100}

if room = room_level2

{x = 200 y = 50}

and so on.


  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users