Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by Zheka. 06/20/24 14:26
Lapsa's very own thread
by rki. 06/19/24 11:27
A simple game ...
by VoroneTZ. 06/18/24 10:50
Face player all the time ...
by bbn1982. 06/18/24 10:25
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,227 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mino, squik, AemStones, LucasJoshua, Baklazhan
19061 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Question for panels and Texts #301569
12/11/09 18:35
12/11/09 18:35
Joined: Mar 2007
Posts: 112
MikeS Offline OP
Member
MikeS  Offline OP
Member

Joined: Mar 2007
Posts: 112
Hi, i haveone question for Panels and texts.

I do havean Text, which shall be displayed in relation to an panel. But if i set the text.pos_x = Panel.pos_x i got an empty pointer for the panel.

I think the reasonis my code struktur, cause i defined the texts befor the panels.

now the question:

Can i do/use an clone panel just like i do it with my functions, i clone all functions at the beginning of my code, to avoid thefunktions dont find each other.

Greetings

Mike

Re: Question for panels and Texts [Re: MikeS] #301601
12/11/09 21:53
12/11/09 21:53
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
Very easy. Set at the top of your Script the following:

PANEL* my_pan;

Now the Compiler knows your Panel will be definied later and after that you can use the text.pos_x = my_pan.pos_x.
After that you can define your Panel:

PANEL* my_pan =
{
...
...
}

You can also use digits to show strings in a Panel and so you don`t have to update the Textpos.

Re: Question for panels and Texts [Re: Widi] #301628
12/12/09 06:32
12/12/09 06:32
Joined: Mar 2007
Posts: 112
MikeS Offline OP
Member
MikeS  Offline OP
Member

Joined: Mar 2007
Posts: 112
ok,great, thank you.

Re: Question for panels and Texts [Re: MikeS] #301643
12/12/09 13:19
12/12/09 13:19
Joined: Mar 2007
Posts: 112
MikeS Offline OP
Member
MikeS  Offline OP
Member

Joined: Mar 2007
Posts: 112
ok, next question :-)

I trie to store 4 variables in one skill.

all variables contain 2 chars.

i tried with this code:

Code:
function display_Armor_data_Front()
{
var Front_Armor_Max;
var Front_Armor_Actual;
var Front_Internals_Max;
var Front_Internal_Actual;
var temp_var1;
var temp_var2;
var my_selected_target;

my_selected_target = selected_target;

while (my_selected_target == Selected_target)
{
str_for_num(str_temp2,your.skill11);
str_trunc(str_temp2,7);
Front_Armor_Max = str_to_num(str_temp2);
str_for_num(str_temp2,your.skill11);
str_trunc(str_temp2,5);
str_clip(str_temp2,2);
Front_Armor_Actual = str_to_num(str_temp2);
str_for_num(str_temp2,your.skill11);
str_trunc(str_temp2,3);
str_clip(str_temp2,4);
Front_Internals_Max = str_to_num(str_temp2);
str_for_num(str_temp2,your.skill11);
str_clip(str_temp2,7);
Front_Internal_Actual = str_to_num(str_temp2);
str_for_num(str_my_selected_target_armor_front1,Front_Armor_Actual);
str_for_num(str_my_selected_target_armor_front,Front_Armor_Max);
str_cat(str_my_selected_target_armor_front,"/");
str_cat(str_my_selected_target_armor_front,str_my_selected_target_armor_front1);

wait (1);
}
}



ok, i defined the skill 11 with 876543.21
what i wanna display with this code is 87/65

what i get is 876/654

is anything wrong with this code??
i dont find it.

Does anybody has an Idea for an maore elegant way to do this, or do i have to work with strings for this?

Greetings

Mike

Re: Question for panels and Texts [Re: MikeS] #301654
12/12/09 15:54
12/12/09 15:54
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
well the 1st question is, why not just use skill11 to skill14?

2ndly str_for_num generates strings with 3 decimals, so your string length (str_len if you wanna check this) is 10

3rdly, most str functions are slow or medium speed, so you don't really want to be doing this every frame, by the looks of what you have there i'd have
Code:
while (my_selected_target != Selected_target)

to only recalculate this once my_selected_target has changed

finally, instead of doing all that, you could use skill11 to store a stuct, and save all the data in there that you need

hope this helps

Re: Question for panels and Texts [Re: MrGuest] #301678
12/12/09 18:43
12/12/09 18:43
Joined: Mar 2007
Posts: 112
MikeS Offline OP
Member
MikeS  Offline OP
Member

Joined: Mar 2007
Posts: 112
ok, the answer for 1 is easy, there will be 9 more armor sections, which i need to control and display, so that would cost me roundabout 40 skills of 100, which is in my opinion too much, so the idea is to spare skills.

ok, str_for_num creates 3 decimals, ok, now i see where the problem is.

Quote:
finally, instead of doing all that, you could use skill11 to store a stuct, and save all the data in there that you need


ok, what is a stuct, what do you mean? i dont know that term.
How could i use this? Maybe u can give me an example?

Oh, and im using A6 com.

Greetings, Mike

Last edited by MikeS; 12/12/09 18:45.
Re: Question for panels and Texts [Re: MikeS] #301699
12/13/09 00:12
12/13/09 00:12
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
ok, structs are not possible with A6 (afaik anyway)

you could also just add more skills to the entity directly in the atypes.h folder, (i'm sure it was still called that in A6)

Re: Question for panels and Texts [Re: MrGuest] #301730
12/13/09 13:10
12/13/09 13:10
Joined: Mar 2007
Posts: 112
MikeS Offline OP
Member
MikeS  Offline OP
Member

Joined: Mar 2007
Posts: 112
hmm, where do i find this folder?


Greetings Mike

Re: Question for panels and Texts [Re: MikeS] #301733
12/13/09 14:17
12/13/09 14:17
Joined: Sep 2009
Posts: 993
Budapest
Aku_Aku Offline
User
Aku_Aku  Offline
User

Joined: Sep 2009
Posts: 993
Budapest
The atypes.h file is in the include folder, inside the 3DGS installation folder.

Re: Question for panels and Texts [Re: Aku_Aku] #301737
12/13/09 15:39
12/13/09 15:39
Joined: Mar 2007
Posts: 112
MikeS Offline OP
Member
MikeS  Offline OP
Member

Joined: Mar 2007
Posts: 112
ok, found the atypes.h folder.

How could i modify this one to get more skills for entities?

Greetings

Mike

Page 1 of 2 1 2

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