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
2 registered members (TipmyPip, 1 invisible), 18,731 guests, and 7 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
digits/windows with vars from ext. language #67682
03/22/06 12:41
03/22/06 12:41
Joined: May 2005
Posts: 338
Brasil
Filipe Offline OP
Senior Member
Filipe  Offline OP
Senior Member

Joined: May 2005
Posts: 338
Brasil
Good morning, all.

I know that when i create a panel using pan_create, i can put digits or windows on it through an script string, like this
Code:


pan_create("digits 122, 56, clip_ammo_frmt_str, clip_ammo_font, 1, ammo;", _VAR(3));




this way, i need the variable, the string and the font to be defined in a wdl script, then i have to get a pointer to that using engine_getobj so i can change it.
If I was to make everything in c++ (because i'm doing everything object-oriented and i don't want to mix it up with scripts), how would it be possible to make a digit show a variable not defined in c-script, but defined in c++?
like
Code:

var l_varMyAmmo;
STRING l_strFormat;
FONT l_fontMyFont;
...
pan_create("digits 122, 56, (l_strFormat)?, (l_fontMyFont)?, 1, (l_varMyAmmo)?;", _VAR(3));




How will that work when i use the acknex.dll instead of the .exe (no script)?

thanks,
Filipe

Re: digits/windows with vars from ext. language [Re: Filipe] #67683
03/22/06 13:08
03/22/06 13:08
Joined: Aug 2005
Posts: 1,230
M
MichaelGale Offline
Serious User
MichaelGale  Offline
Serious User
M

Joined: Aug 2005
Posts: 1,230
Create a panel with digits and attach variables you gave in a wdl, then you write a function in C++ which you call everytime if you wish to update the values, something like that:

Code:

var test;

function refresh_var()
{
DLL_RefreshVar();
}



The DLLFunction gets the var from the script with engine_getobj() and then you can manipulate it.

regards


Your friendly mod is at your service.
Re: digits/windows with vars from ext. language [Re: MichaelGale] #67684
03/22/06 13:42
03/22/06 13:42
Joined: May 2005
Posts: 338
Brasil
Filipe Offline OP
Senior Member
Filipe  Offline OP
Senior Member

Joined: May 2005
Posts: 338
Brasil
thanks, kohji,
but actually i want to do exactly the opposite of that ...
like i said, i'm trying to do everything in c++ with no c-script, cause i don't want to mix object oriented programming with c-script.
so, the problem is not updating the var inside the dll, is defining it inside the dll.
i think there's actually no way to do it, but i know that in the near future i'll be able to use the engine as a dll, and in that case i'd use no c-script at all. so there must be a way to make digits and windows without c-script, if not implemented yet, at least planned for the future...


but thanks anyway.

Re: digits/windows with vars from ext. language [Re: Filipe] #67685
03/22/06 14:54
03/22/06 14:54
Joined: Aug 2005
Posts: 1,230
M
MichaelGale Offline
Serious User
MichaelGale  Offline
Serious User
M

Joined: Aug 2005
Posts: 1,230
You can try this, but I dpn't know for sure, wheter it works like you want:
Code:

void createapanel()
{
var ammo = 30;
STRING ammo_string;
FONT ammp_font;

pan_create("digits 122, 56, ammo_string, ammo_font, 1, ammo;", _VAR(3));
}



If it doesn't work, there is no way to handle this with C++ I think. Good luck


Your friendly mod is at your service.
Re: digits/windows with vars from ext. language [Re: MichaelGale] #67686
03/22/06 15:07
03/22/06 15:07
Joined: May 2005
Posts: 338
Brasil
Filipe Offline OP
Senior Member
Filipe  Offline OP
Senior Member

Joined: May 2005
Posts: 338
Brasil
thanks, but i tried that already...
yeah, i'm guessing there's no way to do it without c-script...
but how would i do it if i was using the engine as a dll?
using the acknex.dll is it still possible and necessary to use c-script?

Re: digits/windows with vars from ext. language [Re: Filipe] #67687
03/22/06 15:15
03/22/06 15:15
Joined: Aug 2005
Posts: 1,230
M
MichaelGale Offline
Serious User
MichaelGale  Offline
Serious User
M

Joined: Aug 2005
Posts: 1,230
If you're creating a DLL for GS you've to use C-Script however and I don't think that is what you want I'm currently working on a project in which I try to handle as many as possible with C++, but everything isn't possible ...

regards


Your friendly mod is at your service.
Re: digits/windows with vars from ext. language [Re: MichaelGale] #67688
03/22/06 19:26
03/22/06 19:26
Joined: May 2005
Posts: 338
Brasil
Filipe Offline OP
Senior Member
Filipe  Offline OP
Senior Member

Joined: May 2005
Posts: 338
Brasil
ok, i realized there is a way to set the variables for the digits, using the digits_set instruction.
like this:
Code:

var m_varClipAmmo;
var m_varTotalAmmo;
PANEL* m_panAmmo;
...
m_panAmmo = pan_create("digits 122, 56, clip_ammo_frmt_str, clip_ammo_font, 1, 0; digits 118, 68, total_ammo_frmt_str, total_ammo_font, 1, 0;", _VAR(3));
digits_set(m_panAmmo, _VAR(1), &m_varClipAmmo);
digits_set(m_panAmmo, _VAR(2), &m_varTotalAmmo);




but what about the format string and the font?
and what about windows definitions? how do i set the variables and the bmap in there without having to define them in c-script?

anyone has any ideas?

Thanks again,
Filipe

Edit: and for buttons?

Last edited by Filipe; 03/22/06 21:20.
Re: digits/windows with vars from ext. language [Re: Filipe] #67689
03/23/06 10:45
03/23/06 10:45
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
For the format, you can use a fixed format string, or a format number.

For the font the only solution at the moment is to open the engine with a small .wdl file with all necessary definitions, including a FONT definition.

Re: digits/windows with vars from ext. language [Re: jcl] #67690
03/23/06 12:28
03/23/06 12:28
Joined: May 2005
Posts: 338
Brasil
Filipe Offline OP
Senior Member
Filipe  Offline OP
Senior Member

Joined: May 2005
Posts: 338
Brasil
ok, thanks again.

Re: digits/windows with vars from ext. language [Re: Filipe] #67691
04/26/07 14:20
04/26/07 14:20
Joined: Mar 2007
Posts: 197
Y
yorisimo Offline
Member
yorisimo  Offline
Member
Y

Joined: Mar 2007
Posts: 197
I am also trying to adjust the font in a digits panel without having to use a .wdl file. I would be satisfied with the internal _a4font but it is too small.
(1)Is there a way to enlarge the font without .wdl?
(2)Are there any other internal fonts (that are larger)?

jcl:"For the font the only solution at the moment is to open the engine with a small .wdl file with all necessary definitions, including a FONT definition."
(3)I have a dll that opens and runs the engine (driven by an external program), how can I attach a .wdl file to define the fonts? (please explain this)

Thanks!


Moderated by  old_bill, Tobias 

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