Gamestudio Links
Zorro Links
Newest Posts
Purchase A8 full licence version
by ukgamer. 04/29/26 18:09
Z9 getting Error 058
by k_ivan. 04/25/26 19:13
ZorroGPT
by TipmyPip. 04/25/26 16:09
Stooq now requires an API key
by jcl. 04/13/26 09:42
Strange "Alien" Skull created with >Knubber<
by NeoDumont. 04/10/26 18:58
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 5,733 guests, and 39 spiders.
Key: Admin, Global Mod, Mod
Newest Members
ukgamer, valino, juergenwue, VladMak, Geir
19210 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Hilfe/Help #399367
04/14/12 16:22
04/14/12 16:22
Joined: Apr 2012
Posts: 8
Karyu Offline OP
Newbie
Karyu  Offline OP
Newbie

Joined: Apr 2012
Posts: 8
Hallo,

ich bin zwar erst ein Anfänger mit Lite-C, habe aber trotzdem (oder gerade deshalb) schon ein Problem:

Ich habe ein Panel mit einem "JA"-Button und einem "NEIN"-Button erstellt.
Wenn ich auf den "JA"-Button drücke, soll
1.) ein/e Model/Entity verschwinden (ent_remove)
2.) eine Variable steigen
3.) das Panel verschwinden

Wenn ich auf den "NEIN"-Button drücke, soll das Panel nur verschwinden.

Punkt 1.) und 2.) habe ich mit einer Funktion geschafft, danach komme ich nicht weiter.

Kann mir jemand helfen?

Grüße
Karyu

For all who can't read German:

Hi,

I'm just a beginner with Lite-C, but I've got a problem:

I created a panel with a "YES"-button and a "NO"-button.
If I press the "YES"-button, the following should happen:
1.) a/n model/entity should vanish (ent_remove)
2.) a variable should rise
3.) the panel should vanish

If I press the "NO"-button, only the panel should vanish.

I did 1.) and 2.) with a function, but then I'm stuck.

Can someone help me?

Karyu

PS.: I'm sorry, if I write bad English!

Last edited by Karyu; 04/14/12 16:36.

Si tacuisses, philosophus mansisses.
Re: Hilfe/Help [Re: Karyu] #399370
04/14/12 16:53
04/14/12 16:53
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
you have to reset the SHOW flag of your panel:

reset(yourPanel, SHOW);

you can also use pan_remove, which removes the whole panel (you can't show it again)


Visit my site: www.masterq32.de
Re: Hilfe/Help [Re: MasterQ32] #399371
04/14/12 16:55
04/14/12 16:55
Joined: Apr 2012
Posts: 8
Karyu Offline OP
Newbie
Karyu  Offline OP
Newbie

Joined: Apr 2012
Posts: 8
Where shall I put this?

Last edited by Karyu; 04/14/12 16:56.

Si tacuisses, philosophus mansisses.
Re: Hilfe/Help [Re: Karyu] #399381
04/14/12 18:21
04/14/12 18:21
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Wie wäre es mit der Funktion die du dem exit-button zugewiesen hast? o_0

Last edited by Ch40zzC0d3r; 04/14/12 19:14.
Re: Hilfe/Help [Re: Ch40zzC0d3r] #399388
04/14/12 19:32
04/14/12 19:32
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
@Ch40zzC0d3r: English, please. Also non-germans should learn from this!

put it in both functions: The yes and the no button should hide the panel
you can put it at the start of those function


Visit my site: www.masterq32.de
Re: Hilfe/Help [Re: MasterQ32] #399391
04/14/12 19:41
04/14/12 19:41
Joined: Apr 2012
Posts: 8
Karyu Offline OP
Newbie
Karyu  Offline OP
Newbie

Joined: Apr 2012
Posts: 8
function Beere1_essen()
{
reset(essen1_pan, SHOW);
ent_remove(Beere1);
Hunger = Hunger + Beere;
}



PANEL* essen1_pan =
{
bmap = "Beere_essen_bmp";
pos_x = 550;
pos_y = 15;
button (15, 40, "Ja.bmp", "Ja.bmp", "Ja.bmp", Beere1_essen, NULL, NULL);
flags = OVERLAY | SHOW;
button (85, 40, "Nein.bmp", "Nein.bmp", "Nein.bmp", NULL, NULL, NULL);
flags = OVERLAY | SHOW;
}


This won't work, because in the function, the engine doesn't know what "essen1_pan" is.
And if I turn it around, the engine doesn't know what "Beere1_essen" is.
It's kind of a paradox.


Si tacuisses, philosophus mansisses.
Re: Hilfe/Help [Re: Karyu] #399399
04/14/12 20:53
04/14/12 20:53
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
PANEL* essen1_pan; // <-- Funktionsprototyp

function Beere1_essen()
{
reset(essen1_pan, SHOW);
ent_remove(Beere1);
Hunger = Hunger + Beere;
}

function nein()
{
reset(essen1_pan, SHOW);
}

PANEL* essen1_pan =
{
bmap = "Beere_essen_bmp";
pos_x = 550;
pos_y = 15;
button (15, 40, "Ja.bmp", "Ja.bmp", "Ja.bmp", Beere1_essen, NULL, NULL);
flags = OVERLAY | SHOW;
button (85, 40, "Nein.bmp", "Nein.bmp", "Nein.bmp", nein, NULL, NULL);
}



Last edited by Widi; 04/14/12 20:58.
Re: Hilfe/Help [Re: Widi] #399404
04/14/12 21:19
04/14/12 21:19
Joined: Apr 2012
Posts: 8
Karyu Offline OP
Newbie
Karyu  Offline OP
Newbie

Joined: Apr 2012
Posts: 8
thank you, it works! grin

Last edited by Karyu; 04/15/12 08:42.

Si tacuisses, philosophus mansisses.

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1