Gamestudio Links
Zorro Links
Newest Posts
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
M1 Oversampling
by 11honza11. 04/20/24 20:57
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, rki), 390 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
can you help me ? -> ent_create[i] for my MEGA SPACE GAME #482051
12/12/20 00:41
12/12/20 00:41
Joined: Oct 2008
Posts: 341
R
ratz Offline OP
Senior Member
ratz  Offline OP
Senior Member
R

Joined: Oct 2008
Posts: 341
Hello everybody laugh

I want to create a "Space Ship ingame Editor" with 6 Moduls, where ou click it together from Panels shocked...

All Spaceship_Moduls are MapEntitys ! ( grin okey.. its an test cause i can't modeling )

i have find out, that you can load it in your level with
Code
ent_create("modul_a.wmb", vector(0,0,0) ,NULL;  

it works great and fast...

but now i have an problem:

how can i "say", witch kind of modules makes the ship ? ... with pointer like this ?

Code
//////////Editor Panel////////////////////

/*

function select_modul_a();
function select_modul_b();
function select_modul_c();
function select_modul_d();
function select_modul_e();
function select_modul_f();

int i;

var modul_var_1[i] = 0;
var modul_var_2[i] = 0;

var modul_x[i];
var modul_y[i];
var modul_z[i];

// panel 
// 
// 


function select_modul_a()
{
  modul_var_2[i] = 1;	
}

function select_modul_b()
{
  modul_var_2[i] = 2;	
}

function select_modul_c()
{
  modul_var_2[i] = 3;	
}

function select_modul_d()
{
  modul_var_2[i] = 4;	
}

function select_modul_e()
{
  modul_var_2[i] = 5;	
}

function select_modul_f()
{
  modul_var_2[i] = 6;	
}


function select_()
 {
  modul_var_1[i] = 1;	
 }
 

function save_craftet_moduls_to_ships_()
 {
  i++;
  ...	
 }


//------------------------------------


function create_modul[i]()
{
 
 if(modul_var_1[i] == 1 && modul_var_2[i] == 1) 
 {
  ent_create("modul_a.wmb",vector(modul_x[i], modul_y[i], modul_z[i]), NULL);
 } 


 if(modul_var_1[i] == 1 && modul_var_2[i] == 2) 
 {
  ent_create("modul_b.wmb",vector(modul_x[i], modul_y[i], modul_z[i]), NULL); 
 } 


 if(modul_var_1[i] == 1 && modul_var_2[i] == 3) 
 {
  ent_create("modul_c.wmb",vector(modul_x[i], modul_y[i], modul_z[i]), NULL);
 } 

 if(modul_var_1[i] == 1 && modul_var_2[i] == 4) 
 {
  ent_create("modul_d.wmb",vector(modul_x[i], modul_y[i], modul_z[i]), NULL); 
 } 

 if(modul_var_1[i] == 1 && modul_var_2[i] == 5) 
 {
  ent_create("modul_e.wmb",vector(modul_x[i], modul_y[i], modul_z[i]), NULL);
 } 

 if(modul_var_1[i] == 1 && modul_var_2[i] == 6) 
 {
  ent_create("modul_f.wmb",vector(modul_x[i], modul_y[i], modul_z[i]), NULL); 
 }
  modul_var_1[i] = 0;
 }

}

function create_ship[i]
{
 "->all clicket moduls + pos...     ->   | or add_shape ?
}



i++ counts up, because i need it for all ships

i hope you know what i mean

and how did i make 2d pos in 3d world pos ?

i hope you can help me laugh
greating: Patrick



Last edited by ratz; 12/15/20 01:06.
Re: can you help me ? -> ent_create[i] [Re: ratz] #482053
12/12/20 10:36
12/12/20 10:36
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Hey Patrick!

For 'saying' if I got you correctl, you can use a list of ENTITYs. Something like this (psesudo-code):
Code
// max amount of ship modules
#define MODULE_MAX 6

// rename those with your ship parts
#define MODULE_ONE 0
#define MODULE_TWO 1
#define MODULE_THREE 2
#define MODULE_FOUR 3
#define MODULE_FIVE 4
#define MODULE_SIX 5

ENTITY *ship_module[MODULE_MAX]; // max 6 modules

void create_ship_modules()
{
	ship_module[MODULE_ONE] = ent_create("modul_a.wmb", pos, NULL);
	ship_module[MODULE_TWO] = ent_create("modul_b.wmb", pos, NULL);
	ship_module[MODULE_THREE] = ent_create("modul_c.wmb", pos, NULL);
	ship_module[MODULE_FOUR] = ent_create("modul_d.wmb", pos, NULL);
	ship_module[MODULE_FIVE] = ent_create("modul_e.wmb", pos, NULL);
	ship_module[MODULE_SIX] = ent_create("modul_f.wmb", pos, NULL);
}
You can manage "MapEntitys " names and position vectors the same way with arrays.

As for 2d pos in 3d pos. As far as I know, there is no real 2d engine, only 3d. So you'll have to set one axis at fixed number for all entities.
F.e. entity can move X (left-right) and Z (up-down) but it's Y position will always stay at 0 (make sure to set this after each c_move call).

Best regards.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: can you help me ? -> ent_create[i] [Re: ratz] #482054
12/12/20 17:51
12/12/20 17:51
Joined: May 2005
Posts: 868
Chicago, IL
Dooley Offline
User
Dooley  Offline
User

Joined: May 2005
Posts: 868
Chicago, IL
You can set a camera view to ISOMETRIC and that might make it look more 2D. It's still a 3D game, but the look would be flat.

Re: can you help me ? -> ent_create[i] [Re: ratz] #482068
12/14/20 23:07
12/14/20 23:07
Joined: Oct 2008
Posts: 341
R
ratz Offline OP
Senior Member
ratz  Offline OP
Senior Member
R

Joined: Oct 2008
Posts: 341
Thank you very mutch

here is a small leak: ... OKEY THIS IS VERRY COOL :
________________________

i want create an 3d Space Game like "EVE" or "HOMEWORLD" where you can travel, build and create Spaceships + management Resorces,Buy an Sell and more...
but all what you see and create, must be works with my Engine* + GUI in 2D and 3D
-> so you can go inside the Spaceship, move and more crazy crazy crazy crazy



My Idea:

-> What does it happen, if you make the same,...but all with an chunk in 1x1x1 Voxel (3D pixel) AND every pixel/Voxel will works like an Atom ???? cool cool cool
-> so you need the Peeriod-System of Elements and many many other Ediors for Materials / and other sfuff! laugh

[Linked Image]

->you can see the Ship Modules laugh
-> later you can build your own modules with materials where you creating with Elements :-O blush tongue



* i need an online databank only for ALL*ALL Elements + CollisionsSystem + own datafiles to save, load and create Materials that you makes with elements and even even even more cry grin
(work in process, t !!!


THIS GAME WILL BE VERRY BIG !

___________________________

GUI TEST VIDEO

[video:youtube]https://www.youtube.com/watch?v=xlggVmMmkfQ[/video]



wasn't there in the past an function, where you can show in View from panls the 3d GameStuio WED (front,top,up ) window ? Aum ?

Last edited by ratz; 12/20/20 21:36.
Re: can you help me ? -> ent_create[i] [Re: ratz] #482071
12/15/20 13:55
12/15/20 13:55
Joined: May 2005
Posts: 868
Chicago, IL
Dooley Offline
User
Dooley  Offline
User

Joined: May 2005
Posts: 868
Chicago, IL
I would suggest starting smaller, get things working with only five elements first. Then once that is working, you can expand to more.

You can use a VIEW and project it onto a bitmap. Look at "bmap_for_entity" in the manual...

Re: can you help me ? -> ent_create[i] for my MEGA SPACE GAME [Re: ratz] #482072
12/15/20 22:37
12/15/20 22:37
Joined: Oct 2008
Posts: 341
R
ratz Offline OP
Senior Member
ratz  Offline OP
Senior Member
R

Joined: Oct 2008
Posts: 341
update grin

[Linked Image]
1/2 year work for all buttons, create in PhotoFilter free


-> last question: how can i made it, that i can scale the main window "DEMO" with the mouse ?


Last edited by ratz; 12/15/20 23:06.
Re: can you help me ? -> ent_create[i] for my MEGA SPACE GAME [Re: ratz] #482073
12/16/20 04:57
12/16/20 04:57
Joined: May 2005
Posts: 868
Chicago, IL
Dooley Offline
User
Dooley  Offline
User

Joined: May 2005
Posts: 868
Chicago, IL
video_window(NULL,NULL,4,NULL);

Re: can you help me ? -> ent_create[i] for my MEGA SPACE GAME [Re: ratz] #482079
12/19/20 14:54
12/19/20 14:54
Joined: Oct 2008
Posts: 341
R
ratz Offline OP
Senior Member
ratz  Offline OP
Senior Member
R

Joined: Oct 2008
Posts: 341
did the define method works with strings, too ?
like this

Code
 

STRING* string1_name = "bla";
STRING* string1_id = "bla bla";
STRING* string1_typ = "bla bla bla";

PANEL* pan_info =
{
   
    digits(710,150,0,*,0,string1_name);
    digits(710,160,0,*,0,string1_id);
    digits(710,170,0,*,0,string1_typ);
     
    layer = 6;
}



with/in this ?

Code

#define STRING_NAME_MAX 6
#define STRING_ID_MAX 6
#define STRING_TYP_MAX 6

#define STRING_NAME_ONE 0
#define STRING_NAME__TWO 1
#define STRING_NAME__THREE 2
#define STRING_NAME__FOUR 3
#define STRING_NAME__FIVE 4
#define STRING_NAME__SIX 5

#define STRING_ID_ONE 0
#define STRING_ID__TWO 1
#define STRING_ID__THREE 2
#define STRING_ID__FOUR 3
#define STRING_ID__FIVE 4
#define STRING_ID__SIX 5

#define STRING_TYP_ONE 0
#define STRING_TYP__TWO 1
#define STRING_TYP__THREE 2
#define STRING_TYP__FOUR 3
#define STRING_TYP__FIVE 4
#define STRING_TYP__SIX 5

STRING *string_name[STRING_NAME_MAX]; 
STRING *string_id[STRING_ID_MAX];
STRING *string_typ[STRING_TYP_MAX]; 


PANEL* pan_info =
{
   
    digits(710,150,0,*,0,string_name[STRING_NAME_MAX]);
 //   digits(710,160,0,*,0,string1_id);
 //   digits(710,170,0,*,0,string1_typ);
     
    layer = 6;
}



Compiler says too many arguments in Digits]

Re: can you help me ? -> ent_create[i] for my MEGA SPACE GAME [Re: ratz] #482081
12/19/20 19:20
12/19/20 19:20
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Well, first of all, you need to initialize those strings, each one with 'str_create'. Also, for displaying text (strings) use TEXT instead of PANEL, without digits (this are for numbers primary).
Aside from that I'm not sure if digits can accept an array... If not then a simpler solution will be copying the content of the needed array, directly into the digits variable.

Code
STRING *list_of_str[10];

TEXT *my_text =
{
	font = "Arial#24bi";
	flags = SHOW;
}

void main()
{
	list_of_str[0] = str_create("#256");
	str_cpy(list_of_str[0], "first_str_goes_here");
	
	// copy content from the array into the text
	str_cpy((my_text.pstring)[0], list_of_str[0]); 
}


Greets!

Last edited by 3run; 12/19/20 19:28. Reason: added an example

Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: can you help me ? -> ent_create[i] for my MEGA SPACE GAME [Re: ratz] #482082
12/19/20 22:28
12/19/20 22:28
Joined: Oct 2008
Posts: 341
R
ratz Offline OP
Senior Member
ratz  Offline OP
Senior Member
R

Joined: Oct 2008
Posts: 341
Code
str_cpy ! That was it ! 
and thanks for all other helping people, Danke euch, echt !
yes i have see the pstring line in manual, but there wasn't a runtime example
sry i use digits, because ->
Code
set(text_txt,  SHOW); 
doesn't work, i don't know why
and i wonedering that it works in digits , because the lite C Manual says
Code
digits(x,y,font, "text",*,var)

... and vars are numbers

Last edited by ratz; 12/20/20 21:37.

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

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