ZFGC

Resources => Coding => Topic started by: Kingknight on August 23, 2008, 03:48:25 pm

Title: [Request] Rupee Engine
Post by: Kingknight on August 23, 2008, 03:48:25 pm
does anyone have a rupee engine? i have been trying to find 1 lately and if you ask, yes i searched on the !@#$% google!

thnx
Kingbite jk Kingknight
Title: Re: [Request] Rupee Engine
Post by: Cassyblanca on August 23, 2008, 06:23:06 pm
... All you have to do is make a single integer variable that stores the number of rupees the player has, and increase that number when the player collides with a rupee object... What the hell more could you possibly need? Why the hell can't you make THIS on your own?

Do you REALLY think you can make a Zelda game if you don't even know how to do something like this? o.O;;
Title: Re: [Request] Rupee Engine
Post by: King Tetiro on August 23, 2008, 06:28:56 pm
Minalien just p*** off and stop insulting every game developer.

kingknight, what program is this in? If it's in gamemaker, I can help.
Title: Re: [Request] Rupee Engine
Post by: Giverny on August 23, 2008, 06:34:29 pm
Minalien just p*** off and stop insulting every game developer.

kingknight, what program is this in? If it's in gamemaker, I can help.
No, for once MiNalien has a very good point.
Ill be back in about five second with a gmd.

EDIT: !@#$% this. Linux is !@#$% when it comes to emulating GM, so Im not going to waste so many nerves on something that anybody can write.
If you cant write your own rupee engine, RTFM, and dont make a zelda game.
/endpissed
Title: Re: [Request] Rupee Engine
Post by: King Tetiro on August 23, 2008, 06:41:02 pm
@ Giverny - I know that it's just how he/she said it (Still dunno which Minalien is)

Do you REALLY think you can make a Zelda game if you don't even know how to do something like this? o.O;;
I my honest opinion, he/she is implying that kingknight can't make a zelda game. That's why I got ticked off.
Title: Re: [Request] Rupee Engine
Post by: Kingknight on August 23, 2008, 06:43:19 pm
Minalien is it really that simple? oh... well i still dont know how to do it lol
im using Gamemaker yes and as i said im kinda new to game development :P
Title: Re: [Request] Rupee Engine
Post by: Kylink on August 23, 2008, 06:43:25 pm
I don't know if it's still hosted, but Yoshi had a pretty good one I think. I'm assuming this is in Game Maker.

http://www.zfgc.com/forum/index.php?topic=3363.0 (http://www.zfgc.com/forum/index.php?topic=3363.0) <- The topic.

But what Min was saying was to have a variable such as:
Code: [Select]
global.rupees=0;Then, when you collide with the rupee object, it should increase it by one and destroy the rupee object:
Code: [Select]
global.rupees+=1;
instance_destroy()

If you want to know how to DRAW the rupees on screen, that's a different problem. Here's what I did, I'm sure there is better ways out there though.
Code: [Select]
//This draws the little rupee icon that is in the corner of the screen
draw_sprite(spr_rupee_rupee,0,view_xview[0]+8,view_yview[0]+240-16);

//if you have no rupees, it will draw three zeros. You can change this depending on wallet size or whatever.
if global.rupees=0
{
    draw_text(view_xview[0]+19,view_yview[0]+240-14,'000',);
}
//if you have less than 10 rupees, but more than 1, it will draw two zeros, plus the amount of rupees you have. //And etc.
if global.rupees>0 {
    if (global.rupees<10) {
        draw_text(view_xview[0]+19,view_yview[0]+240-14,'00'+string(global.rupees));
        }
    else if (global.rupees<99 || global.rupees=99) {
        draw_text(view_xview[0]+19,view_yview[0]+240-14,'0'+string(global.rupees));
        }
    else {
        draw_text(view_xview[0]+19,view_yview[0]+240-14,string(global.rupees));
        }
}

if (global.rupees=global.rupeeMax) {
    draw_text(view_xview[0]+19,view_yview[0]+240-14,global.rupees);
    }

Try that. I haven't used any of this for a while, so I'm a little rusty, and like I said, this isn't the best way to do it. Make sure you familiarize yourself with actually learning what variables are, and not just when to use them, but also HOW and WHY they work. Then you can actually code without examples and tutorials as guides.
Title: Re: [Request] Rupee Engine
Post by: Giverny on August 23, 2008, 06:52:21 pm
@ Giverny - I know that it's just how he/she said it (Still dunno which Minalien is)

Do you REALLY think you can make a Zelda game if you don't even know how to do something like this? o.O;;
I my honest opinion, he/she is implying that kingknight can't make a zelda game. That's why I got ticked off.
You shouldnt get ticked off. MiN is right. If you cant make a number appear on he scren, your out of luck when you try programming a cliff jumping engine, and enemy engine, etc.
Title: Re: [Request] Rupee Engine
Post by: Xiphirx on August 23, 2008, 08:44:59 pm
Its in various engines...

find it, or make it.
Title: Re: [Request] Rupee Engine
Post by: Kingknight on August 24, 2008, 01:19:47 am
Kylink I'm having troubles with your code, this is what I get:
Code: [Select]
___________________________________________
ERROR in
action number 1
of Draw Event
for object obj_rupee:

Error in code at line 22:
   if (global.rupees=global.rupeeMax) {

at position 27: Unknown variable rupeeMax
Title: Re: [Request] Rupee Engine
Post by: wildex999 on August 24, 2008, 09:50:10 am
The error looks pretty clear to me, you haven't set the variable rupeeMax. just write global.rupeeMax=99;   or something.
Title: Re: [Request] Rupee Engine
Post by: Kingknight on August 25, 2008, 04:06:52 am
in what obj rupee?
Title: Re: [Request] Rupee Engine
Post by: 4Sword on August 25, 2008, 04:18:49 am
No, in the object that is drawing the rupee count as it is what has to know what the maximum is and having it in obj_rupee would set it to the same value on each collision which is horribly inefficient.
Title: Re: [Request] Rupee Engine
Post by: Kingknight on August 25, 2008, 04:31:11 am
[edit] ah !@#$% im confused
how do i make the numbers in the corner a smaller size to fit the screen?
Title: Re: [Request] Rupee Engine
Post by: 4Sword on August 25, 2008, 04:33:43 am
It isn't going to work perfectly.  In Kylink's code it should be this:
Code: [Select]
if (global.rupees != global.rupeeMax)
{
  global.rupees+=1;
}
instance_destroy()

Then again, I do not know what you really used.
Title: Re: [Request] Rupee Engine
Post by: Kylink on August 25, 2008, 05:38:20 am
It isn't going to work perfectly.  In Kylink's code it should be this:
Code: [Select]
if (global.rupees != global.rupeeMax)
{
  global.rupees+=1;
}
instance_destroy()

Then again, I do not know what you really used.
Uh, yah. I'm not completely sure in my code, that was more of a base than anything.
Title: Re: [Request] Rupee Engine
Post by: 4Sword on August 25, 2008, 05:40:40 am
I figured it was better to answer what could have been one of his future questions; it is not so much that I was being critical of you, I am nit-picky for little things that lead to problems if they go unchecked, it's just how I think.
Title: Re: [Request] Rupee Engine
Post by: Darth RPG on August 25, 2008, 01:02:28 pm
In fact it should be:
Code: [Select]
global.rupees = min(global.rupees + 1, global.rupeeMax);
But as Minalien has pointed I don't think this guy's posts is worth so much replies, considering that he is "making" a Zelda game and he doesn't even know how to make a rupee engine.
Title: Re: [Request] Rupee Engine
Post by: Giverny on August 25, 2008, 02:52:50 pm
In fact it should be:
Code: [Select]
global.rupees = min(global.rupees + 1, global.rupeeMax);
But as Minalien has pointed I don't think this guy's posts is worth so much replies, considering that he is "making" a Zelda game and he doesn't even know how to make a rupee engine.
QFT'D
Title: Re: [Request] Rupee Engine
Post by: Mirby on August 25, 2008, 07:10:02 pm
There's this guy at RPM named irregularhunterSZ who firmly believes in a disproven theory. Yet his posts got many replies. Actually, irregularhunterSZ::Kingknight
Title: Re: [Request] Rupee Engine
Post by: Xiphirx on August 25, 2008, 07:11:32 pm
There's this guy at RPM named irregularhunterSZ who firmly believes in a disproven theory. Yet his posts got many replies. Actually, irregularhunterSZ::Kingknight

wth?
Title: Re: [Request] Rupee Engine
Post by: Mirby on August 25, 2008, 07:21:54 pm
I was agreeing with what Giverny was agreeing with. Anyways, if you can't get a rupee engine on your own, maybe you should start with something simpler. Or you could use Zelda Classic.
Title: Re: [Request] Rupee Engine
Post by: Giverny on August 26, 2008, 02:12:21 am
I was agreeing with what Giverny was agreeing with. Anyways, if you can't get a rupee engine on your own, maybe you should start with something simpler. Or you could use Zelda Classic.
Better just to learn C than ZC.
Title: Re: [Request] Rupee Engine
Post by: Mirby on August 26, 2008, 05:21:28 pm
Just a suggestion. If he wants to make a Zelda game and can't figure out how to work rupees, he should use ZC where everything like that is done for him already.
Title: Re: [Request] Rupee Engine
Post by: Kingknight on August 26, 2008, 09:38:10 pm
actually i might lock this topic because i figured most of the problems out with Kylink's script, thnx Kylink XD

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