Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (AndrewAMD, Ayumi, NewbieZorro), 14,141 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Dynamic Buttons and Panels and Texts? #118378
03/20/07 10:33
03/20/07 10:33
Joined: Jan 2007
Posts: 36
Montana
webgovernor Offline OP
Newbie
webgovernor  Offline OP
Newbie

Joined: Jan 2007
Posts: 36
Montana
Hi All!

I must say I love the speed and quality at which questions get answered on these forums, my favorites 3d development community by a long shot.

Anyway, I'm attempting to write and inventory for my game, just a simple list based button style (like ES Oblivion or Fallout), but ALL the tutorials and sample code I could find was based off of a "slot" type inventory, like in Diablo or Neverwinter Nights.

I'm trying to find a way to dynamically draw the item's text and button, but I'm having no luck with the way 3DGS does the TEXTs sepperate from BUTTONS and PANELS... to give an example of what I'd like to do:


Code:


function display_inventory() {
var i = 1;
while(inventory[i*inv_i + inv_name] != NULL) {
string item_name = inventory[i*inv_i + inv_name];
var item_value = inventory[i*inv_i + inv_value];
var item_damage = inventory[i*inv_i + inv_damage];
some_text.string[i] = item_name+string(item_value)+string(item_damage);
some_panel.button[i] = 10,20*i,myBmp,myBmp,myBmp,myFunction,null,null;
i += 1;
}
}



Basically, what this would do (if this was possible) would be to list multiple buttons (with dynamic text over them) that display the item's properties, while allowing me to call a specific function that "uses" the item.

I can't seem to find a way of doing this using panels and buttons, I can generate the text just fine, but I can't run a function when I click that text...

In conclusion, my questions are:

1) Should I be using some other method besides panels and buttons?
2) Because of the lack of "objects", should I even be using C-Script for this?
3) Should I just "suck it up" and use a Diablo-like SLOT inventory system?

I do appreciate any help with this, but I know this is kind of complicated and I don't expect people to do the work for me.

Thanks in advance,

-Aaron

Last edited by webgovernor; 03/20/07 10:35.
Re: Dynamic Buttons and Panels and Texts? [Re: webgovernor] #118379
03/20/07 13:29
03/20/07 13:29
Joined: Jan 2007
Posts: 36
Montana
webgovernor Offline OP
Newbie
webgovernor  Offline OP
Newbie

Joined: Jan 2007
Posts: 36
Montana
After doing some more research, and reading the various existing inventory systems, I've concluded that I must make a separate PANEL for EVERY SINGLE SLOT... I REALLY want to be wrong here, but I'm not, even the RPG Template pack has a super-bloated inventory system. So, I'm just posting this to let people know that my question has been answered.

1) Panels and/or Buttons are the only "practical" methods for designing an inventory.
2) C-Script is not suited for this particular project, but it is possible with massive amounts of code.
3) The diablo-like inventory is easier then the Oblivion/Fallout type, but it requires a lot of work either way.

Just incase someone finds a revolutionary new way to do this not implemented in AUM or the RPG template pack, then please let me know.

I hope this helps someone.

-Aaron

Re: Dynamic Buttons and Panels and Texts? [Re: webgovernor] #118380
04/09/07 00:13
04/09/07 00:13
Joined: May 2004
Posts: 1,510
Denmark
Claus_N Offline
Serious User
Claus_N  Offline
Serious User

Joined: May 2004
Posts: 1,510
Denmark
Quote:

I've concluded that I must make a separate PANEL for EVERY SINGLE SLOT... I REALLY want to be wrong here, but I'm not



I'm sorry to say that you're not wrong - at least as long as we are talking about c-script.
I don't know about Lite-C, as I've never tried it - I haven't used 3DGS for a few months now (I'm learning Managed DirectX programming in C# ).

Quote:

C-Script is not suited for this particular project, but it is possible with massive amounts of code



Exactly. I've created a diablo-style inventory once in C-script, and I'll NEVER do that again

The best way to do it would be through a DLL, or maybe it can be done easily in Lite-C

Re: Dynamic Buttons and Panels and Texts? [Re: Claus_N] #118381
04/09/07 15:46
04/09/07 15:46
Joined: Jul 2006
Posts: 503
Australia
A
adoado Offline

User
adoado  Offline

User
A

Joined: Jul 2006
Posts: 503
Australia
I wrote an Inventory system - and It was not easy...

And yes I think the only way is with panels (and a DLL I agree) - although you can create panels dynamically during the game. It is possible to do, it just takes time and some planning on how you are going to do it before hand.

Goodluck!
Adoado


Visit our development blog: http://yellloh.com

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