Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, Akow, degenerate_762), 1,430 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
How can I use a clicked key to trigger a panel? #228548
09/20/08 13:00
09/20/08 13:00
Joined: Jun 2006
Posts: 35
Texas
D
DancesWithLight Offline OP
Newbie
DancesWithLight  Offline OP
Newbie
D

Joined: Jun 2006
Posts: 35
Texas

I'm writing a game in A6 standard. Please don't ask me to upgrade now. I bought it in 2005 and am finally catching on how to write WDL. I'm not a good programmer, but I can create panels. I understand the number of a key corresponding to a door is Skill 4.

My question is, I would like to have 8 panels, each one appearing when a particular key is found. How do I write ACTIONS to show 8 different panels when their key is found?
Like game_panel_1, game_panel_2 corresponding to key 1, key 2, and so on? The artworks would be like a reward for finding the key, like a bishoujo game. In my case they'd advance the story, and have to be found in order. Also they have text on them.

I know how write panels in WDL and how to put a button on a panel so the player can close the panel and go back to the level. I'm not clear on how to write an action that makes a panel triggered by clicking on a key. I want to associate for example,
game_panel_1.visible on, with clicking key one.
Instead of activating locked doors you see. No locked doors in my game so door keys arent' needed.

Help please? Thanks


Waiting for fully immersible Virtual reality.
Re: How can I use a clicked key to trigger a panel? [Re: DancesWithLight] #228568
09/20/08 16:47
09/20/08 16:47
Joined: Sep 2003
Posts: 733
Whitefish, Montana
JazzDude Offline
User
JazzDude  Offline
User

Joined: Sep 2003
Posts: 733
Whitefish, Montana
Code:
function show_panel_one()
{
   panel_one.visible = on;
}

on_x = show_panel_one 

///to close the panel

function close_panel_one()
{
   panel.one.visible = off;
}

///add "on_click = close_panel_one"  to the panel one code
and clicking on the panel will close it.


Or you might want to toggle the panel on/off with the same key.

Re: How can I use a clicked key to trigger a panel? [Re: JazzDude] #228573
09/20/08 17:34
09/20/08 17:34
Joined: Jun 2006
Posts: 35
Texas
D
DancesWithLight Offline OP
Newbie
DancesWithLight  Offline OP
Newbie
D

Joined: Jun 2006
Posts: 35
Texas
Thanks, Jazz Dude, Really.

I have no problem writing a function to show a panel. I need an action to attach to a key object. Right? So if the player finds and clicks on that object, a panel will open. Thats what I need, and action to attach to a key! But thanks for answering so quickly.

AB


Waiting for fully immersible Virtual reality.
Found an answer to triggering a panel to show. [Re: DancesWithLight] #228584
09/20/08 18:33
09/20/08 18:33
Joined: Jun 2006
Posts: 35
Texas
D
DancesWithLight Offline OP
Newbie
DancesWithLight  Offline OP
Newbie
D

Joined: Jun 2006
Posts: 35
Texas
Hang on, I found an answer. I looked in AUM wdl resources and found the code below. I should be able to change it for my purpose:

/// a touch and show panel wdl by Dreamkiller and Realspawn

///////////////Bmaps/////////////////
bmap test_for_5sec = <test.bmp>; (or your own file name)
//////////////Panels////////////////////

Panel test_panel
{
Layer 2;
bmap = test_for_5sec;
flags = refresh,d3d,transparent;
}

string textap_str = "You did it !";

text you_did
{
pos_x = 300;
pos_y = 240;
font = standard_font;
string = textap_str;
layer = 10;
flags = transparent, d3d, center_x, center_y, narrow;
}

///////////////////new/////////////
function text()
{
set you_did.visible,on;
set you_did.visible,on;
waitt(80);
set test_panel.visible,off;
set you_did.visible,off;
wait(1);
} }

ACTION Show_pictext {
SET MY.ENABLE_IMPACT, ON;
SET MY.EVENT text;
}


Waiting for fully immersible Virtual reality.

Gamestudio download | chip programmers | 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