Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: [GM6] a problem regarding rupees and different rooms  (Read 2788 times)

0 Members and 1 Guest are viewing this topic.

pxl_moon (dotyue)

Team Dekunutz
[GM6] a problem regarding rupees and different r...
« on: October 17, 2006, 06:18:35 pm »
  • .越//
  • *
  • Reputation: +5/-1
  • Offline Offline
  • Gender: Male
  • Posts: 2280
i posted that first in IGC but it is several times down O_o


well.. my problem:

when i make a room with rupees, i take one, goto another room and then back to the first.
- How can i make it that the Rupee is gone when i come back?!

when the room is persistent then i cant go back
when the rupee is, then it is in every room and reloads when i come back to room1
« Last Edit: January 03, 2007, 10:05:41 pm by 4Sword »
Logged

~~Resources~~
~Minish Cap Style~

Minish Cap Beta:Firerod Icon, Majoras Mask:ChuChu, Ocarina of Time:Gossip Stone, Oracle Series:Link plays the "Herpes of Ages", Impa, Wand Maker: HUD
~GB-Zelda Style~
Ocarina of Time: Deku Caca
~Other~
Paper Mario Style Zelda&Link, Tetra Trackers HUD-Cleanups

Re: [GM6] a problem regarding rupees and differe...
« Reply #1 on: October 17, 2006, 06:33:07 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
I don't use GM, but surly you could use the easy solution, which is to have a global variable called, say, 'Ruppee1Found'. When the object is picked up it will set that variable to true. And when the object is created it will check the global and delete itself if it is set to true.
Logged

pxl_moon (dotyue)

Team Dekunutz
Re: [GM6] a problem regarding rupees and differe...
« Reply #2 on: October 17, 2006, 06:52:58 pm »
  • .越//
  • *
  • Reputation: +5/-1
  • Offline Offline
  • Gender: Male
  • Posts: 2280
I don't use GM, but surly you could use the easy solution, which is to have a global variable called, say, 'Ruppee1Found'. When the object is picked up it will set that variable to true. And when the object is created it will check the global and delete itself if it is set to true.

well thats not "so" easy when you think of the amount of rupees... but maybe a coding genie has a script idea with that ^^
 yes.... thx anyways
Logged

~~Resources~~
~Minish Cap Style~

Minish Cap Beta:Firerod Icon, Majoras Mask:ChuChu, Ocarina of Time:Gossip Stone, Oracle Series:Link plays the "Herpes of Ages", Impa, Wand Maker: HUD
~GB-Zelda Style~
Ocarina of Time: Deku Caca
~Other~
Paper Mario Style Zelda&Link, Tetra Trackers HUD-Cleanups

Re: [GM6] a problem regarding rupees and differe...
« Reply #3 on: October 17, 2006, 07:14:21 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
Just make an array of flags then and map the array index to the objects instance id.
Logged

pxl_moon (dotyue)

Team Dekunutz
Re: [GM6] a problem regarding rupees and differe...
« Reply #4 on: October 17, 2006, 08:31:11 pm »
  • .越//
  • *
  • Reputation: +5/-1
  • Offline Offline
  • Gender: Male
  • Posts: 2280
Just make an array of flags then and map the array index to the objects instance id.

i really have no idea how to work with that, well i think i have to think of something
Logged

~~Resources~~
~Minish Cap Style~

Minish Cap Beta:Firerod Icon, Majoras Mask:ChuChu, Ocarina of Time:Gossip Stone, Oracle Series:Link plays the "Herpes of Ages", Impa, Wand Maker: HUD
~GB-Zelda Style~
Ocarina of Time: Deku Caca
~Other~
Paper Mario Style Zelda&Link, Tetra Trackers HUD-Cleanups

Re: [GM6] a problem regarding rupees and differe...
« Reply #5 on: October 17, 2006, 08:34:16 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
Pusedo Code:

When you pick up a rupee:
Code: [Select]
myPickedUpFlagArray[thisObjectsInstanceID] = true;

When you create a ruppe:
Code: [Select]
if (myPickedUpFlagArray[thisObjectsInstanceID] == true)
{
DestroyObject(thisObject);
}
Logged
Re: [GM6] a problem regarding rupees and differe...
« Reply #6 on: October 17, 2006, 11:26:14 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 448
Hmmm... You just want it so if you pickup the rupee it's gone?
Make a colision event with link in the rupee object and in that.....
put the code to make your rupee count go up, and then "instance_destroy". Make sure that its set to affect "self".
Logged

pxl_moon (dotyue)

Team Dekunutz
Re: [GM6] a problem regarding rupees and differe...
« Reply #7 on: October 18, 2006, 10:00:27 am »
  • .越//
  • *
  • Reputation: +5/-1
  • Offline Offline
  • Gender: Male
  • Posts: 2280
Hmmm... You just want it so if you pickup the rupee it's gone?
Make a colision event with link in the rupee object and in that.....
put the code to make your rupee count go up, and then "instance_destroy". Make sure that its set to affect "self".

no.... i'm not such a fool... i want that a rupee is gone AND when i come back to the room, it still is gone
Logged

~~Resources~~
~Minish Cap Style~

Minish Cap Beta:Firerod Icon, Majoras Mask:ChuChu, Ocarina of Time:Gossip Stone, Oracle Series:Link plays the "Herpes of Ages", Impa, Wand Maker: HUD
~GB-Zelda Style~
Ocarina of Time: Deku Caca
~Other~
Paper Mario Style Zelda&Link, Tetra Trackers HUD-Cleanups

Re: [GM6] a problem regarding rupees and differe...
« Reply #8 on: October 18, 2006, 03:18:28 pm »
  • Am i here or am i not?...
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 238
i know!

make an alarm!

when its end then make the rupee disipear...
Logged
Re: [GM6] a problem regarding rupees and differe...
« Reply #9 on: October 18, 2006, 11:07:40 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 448
Hmmm... You just want it so if you pickup the rupee it's gone?
Make a colision event with link in the rupee object and in that.....
put the code to make your rupee count go up, and then "instance_destroy". Make sure that its set to affect "self".

no.... i'm not such a fool... i want that a rupee is gone AND when i come back to the room, it still is gone
Hmmm so is the rupee lying on the ground or is it create by cutting a bush ect? Do you have any idea why you cant go back if the room is persistant? Could something be wrong witth your room transtion? This info could help ;)EDIT: Just remebered this,lol. In the create event(rupee) make a variable called "global.picked" and set it to false. And in the collision with link, set it to true. I guess you could then put in the room code"if global.picked=true>>"instance_destroy", you'd probably need to put an object ID in there also if theres more than one rupee.Try to get the persistant room thing working first though.
« Last Edit: October 18, 2006, 11:15:40 pm by ZoSo »
Logged
Re: [GM6] a problem regarding rupees and differe...
« Reply #10 on: October 22, 2006, 08:07:36 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 647
i know!

make an alarm!

when its end then make the rupee disipear...

He wasn't asking for that, at all.
Logged

Antidote

>.>
Re: [GM6] a problem regarding rupees and differe...
« Reply #11 on: October 30, 2006, 03:41:27 pm »
  • In all seriousness who's serious?
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1485
i found a way to do this:
in the Create Event of the player put this
Code: GML
  1. switch(room)
  2. {
  3.  case rmYourRoom:
  4.  global.Rupee_number = 0;
  5.  for (i = 0; i <= instance_number(objRupee); i += 1)
  6.  {
  7.     if !variable_global_array2_get(&#39;Picked&#39;, room, i)
  8.    {
  9.       global.Picked[room,i] = false;
  10.    }
  11.   }
  12.   break;
  13. }
  14.  
then in the create event of the rupee object put this
Code: GML
  1. {
  2.   rupee_number = global.Rupee_number;
  3.   global.Rupee_number += 1;
  4.   if global.Picked[room,rupee_number] = true
  5.   {
  6.     instance_destroy
  7.   }
  8. }
  9.  
And that should make the respective automatically delete itself
i hope this helps
« Last Edit: November 08, 2006, 01:14:15 pm by MiNalien »
Logged
  • Axiomatic Data Laboratories
Re: [GM6] a problem regarding rupees and differe...
« Reply #12 on: November 08, 2006, 04:09:44 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 122
make the rupee persistent and make sure that it's created by a controller that's persistent (destroy the rupee, not the controller).
This way, the controller will makes the rupees variables global, and the rupee will still have been destroyed. of course...this could create lag due to the many controllers...so...maybe this isn't the greatest idea...
Logged
Re: [GM6] a problem regarding rupees and differe...
« Reply #13 on: November 11, 2006, 01:23:44 pm »
  • Personal Text
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1229
if you want Zelda type rooms, where everything is the same when you leave and come back.  I suggest that you make the ROOM persistant, and if you come in collision with the rupee and it is destroyed, then it will STAY destroy.  Same with a chest.  if the "open" variable is inisiated, then it will stay like that forever.  its kinda like the start of life or time, you can't go back to what you did ^_^
also, you can add as many chests you like as long as the"open" variable isn't a "global." variable"
Same goes for rupees.  This is the code I did for all my rupees:

Instead of putting "Collison with rupee" in the main character's events(It will only get clustered)
put the drag and drops in the "Collision with Character" event in the RUPEE'S events.
(Play sound) (Rupee Sound)
(Drag and drop)Destroy instance SELF!
(custom Code) (Your rupee add code)

Hope that helps ^_^
Logged
Re: [GM6] a problem regarding rupees and differe...
« Reply #14 on: November 11, 2006, 02:37:51 pm »
  • [sic]
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 2334
I just use one room, with custom "transitions" from one boundaried area to another.
Logged
Re: [GM6] a problem regarding rupees and differe...
« Reply #15 on: November 11, 2006, 04:57:50 pm »
  • Personal Text
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1229
but what if you entered a cave or something? and then you came out?  then EVERYTHING that happend within that huge overworld would be back to normal.
still, using room persistance is the best way to go for Game Maker.
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.058 seconds with 67 queries.

anything