The Daily Click ::. Forums ::. Klik Coding Help ::. gun collection.
 

Post Reply  Post Oekaki 
 

Posted By Message

siven

I EAT ROCKS

Registered
  03/11/2008
Points
  604

Wii OwnerVIP Member
15th December, 2008 at 23:58:22 -

ok, im my game i want it so when you pick up a gun that you have never picked up before, it will place it in the acquired guns spot in the command ship, which is a different frame, how would i go about doing this? ive tried a few ways but havnt had any success, ill keep trying things though

 
[Game design makes my brain feel like its gonna explode.]

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
16th December, 2008 at 00:08:03 -

use an array and make it global to the game.

 
n/a

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
16th December, 2008 at 01:09:21 -

you just need to store the data in a way that the game will remember across frames. If you have global values to spare you can easily use them like flags. (0 or 1)

So when you don't have a particular gun, the global value it's related to is 0 and when you do the global value is 1 (even better if you can collect multiple you can still use just the one global value)

so say you want to code it so

Pistol = Global value A (0 or 1 have or don't have)
uzi = Global value B (0 or 1 have of don't have)
grenade = Global value C (0 up to 99)

then when you go to your gun collection frame make events to check what the current global values are set to. Then if they aren't 0 display the gun. and put a counter next to the ones that can have more than 1.

easy!


 
.

siven

I EAT ROCKS

Registered
  03/11/2008
Points
  604

Wii OwnerVIP Member
16th December, 2008 at 01:22:31 -

well i dont know how to use arrays...
you missunderstood me, though what you said was helpful for something else, but i just want it to display that youve picked up that weapon before, that its been discovered, like in the megaman battle network games your library of chips, or in sonic unleashed how you pick up secret documents and pictures and what not

 
[Game design makes my brain feel like its gonna explode.]

W3R3W00F

Drum and Bass Fueled Psycho

Registered
  08/11/2008
Points
  370

VIP MemberCardboard BoxThe Cake is a Lie
16th December, 2008 at 02:11:58 -

Neatos! I Didn't think about using the array object for that!(probably because I've never tried it. ) I'll have to try that sometime. Thanks for the advice I never even asked for!

 
n/a

siven

I EAT ROCKS

Registered
  03/11/2008
Points
  604

Wii OwnerVIP Member
16th December, 2008 at 02:56:37 -

... right... anyway, i got it working with flags, but if someone has an easier way let me know

 
[Game design makes my brain feel like its gonna explode.]

[DELETED]

Likes to put dots on paper

Registered
  08/12/2008
Points
  118

MushroomVIP MemberARGH Sign
16th December, 2008 at 07:44:32 -

What AndyUK had previously said was exactly the answer to the question you asked. You want your game to remember that you've picked up a gun and show it on a separate frame; Global Values are the most simplest and easiest way to do so. If you didn't understand him;

If you have the gun, set a global value to 1.

If you are on that extra frame, and global value = 1, display information about that gun you have discovered.

If you are trying to do this for, say above 10 or more objects (where you don't have enough global values to use separately for each one), then you will probably want to use a save/load system where you can externally keep the data that will tell your game what you have and have not discovered.

 
n/a

-J-



Registered
  05/10/2008
Points
  228

VIP MemberThe Cake is a Lie
16th December, 2008 at 08:33:15 -

There's an extension called Global Store X aswell. It's very handy as it stores values and strings globally and can save the data to INI or binary files.

 
n/a ...

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
16th December, 2008 at 09:28:21 -

they all work. an array is not the simplest but its probably the most efficient and flexible. it allows for not just that you have the gun but you can also store how much ammo and any other info you may need to store across frames. and yes you can save it externally as well.

 
n/a

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
16th December, 2008 at 17:10:51 -

The only problem is that just telling him to use an array isn't very helpful. You need to show him step by step.

 
.

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
17th December, 2008 at 03:00:56 -

but im too lazy

 
n/a

W3R3W00F

Drum and Bass Fueled Psycho

Registered
  08/11/2008
Points
  370

VIP MemberCardboard BoxThe Cake is a Lie
17th December, 2008 at 03:09:52 -

Go check the articles. They might have a tutorial for array objects. If not, someone really should make one. It would solve some good number of problems and answer a large number of queries. I can't make one because I tried it. I'm braindead when it comes to array objects.

 
n/a

siven

I EAT ROCKS

Registered
  03/11/2008
Points
  604

Wii OwnerVIP Member
18th December, 2008 at 11:50:16 -

dont worry about it guys, i got it working using a really simple method. but thanks for all the advice

 
[Game design makes my brain feel like its gonna explode.]
   

Post Reply



 



Advertisement

Worth A Click