3 registered members (Ayumi, Akow, AndrewAMD),
1,505
guests, and 9
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
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
ratz
OP
Senior Member
|
OP
Senior Member
Joined: Oct 2008
Posts: 341
|
Hello everybody I want to create a "Space Ship ingame Editor" with 6 Moduls, where ou click it together from Panels ... All Spaceship_Moduls are MapEntitys ! ( okey.. its an test cause i can't modeling ) i have find out, that you can load it in your level with 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 ?
//////////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 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
Senior Expert
|
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): // 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.
|
|
|
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
ratz
OP
Senior Member
|
OP
Senior Member
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 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 ???? -> so you need the Peeriod-System of Elements and many many other Ediors for Materials / and other sfuff! ->you can see the Ship Modules -> later you can build your own modules with materials where you creating with Elements :-O * 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 (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] for my MEGA SPACE GAME
[Re: ratz]
#482072
12/15/20 22:37
12/15/20 22:37
|
Joined: Oct 2008
Posts: 341
ratz
OP
Senior Member
|
OP
Senior Member
Joined: Oct 2008
Posts: 341
|
update 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]
#482079
12/19/20 14:54
12/19/20 14:54
|
Joined: Oct 2008
Posts: 341
ratz
OP
Senior Member
|
OP
Senior Member
Joined: Oct 2008
Posts: 341
|
did the define method works with strings, too ? like this
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 ?
#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
Senior Expert
|
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.
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
|
|
|
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
ratz
OP
Senior Member
|
OP
Senior Member
Joined: Oct 2008
Posts: 341
|
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 -> doesn't work, i don't know why and i wonedering that it works in digits , because the lite C Manual says digits(x,y,font, "text",*,var) ... and vars are numbers
Last edited by ratz; 12/20/20 21:37.
|
|
|
|