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
1 registered members (TipmyPip), 18,449 guests, and 6 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
Page 4 of 8 1 2 3 4 5 6 7 8
Re: Formula Cars "Editor" in game [Re: Carloos] #110819
02/21/07 05:14
02/21/07 05:14
Joined: Sep 2002
Posts: 8,177
Netherlands
PHeMoX Offline
Senior Expert
PHeMoX  Offline
Senior Expert

Joined: Sep 2002
Posts: 8,177
Netherlands
Quote:

* Click in 2D and get 3D cordinates is still bad, but works when you get the hummm hand on it... ( Maybe someone has a point and select script ? )




What's exactly your problem with this? Are you not getting the right 3D positions?

Using the following line should give you the exact 3D coordinates of a click:
Code:

var pos1;
var pos2;
pos1.x = mouse_pos.x;
pos1.y = mouse_pos.y;
pos1.z = 0;//0
vec_for_screen(pos1, camera);
pos2.x = mouse_pos.x;
pos2.y = mouse_pos.y;
pos2.z = 100000; //20000 use a big value here
vec_for_screen(pos2, camera);
trace_mode = ignore_passable + ignore_Sprites + ignore_models;
target =0;
c_trace(pos1, pos2,trace_mode);


After that simply save the 'target' it will return and use it.


Cheers


PHeMoX, Innervision Software (c) 1995-2008

For more info visit: Innervision Software
Re: Formula Cars "Editor" in game [Re: PHeMoX] #110820
02/21/07 07:50
02/21/07 07:50
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline
Expert
Germanunkol  Offline
Expert

Joined: Jun 2006
Posts: 2,640
Earth
Hey, that's very cool.
I'm wondering: How did you do the "corners" if the selected unit?
Are they just another model? Looks like it... but then how do you set it to be exactly the size your selected object? Or don't you?

An ingame editor's pretty cool. Does that mean you'll have a map editor in the game? but then what are you going to do with roads? they'll be hard to put in in an ingame editor...?

keep it up!
Micha


~"I never let school interfere with my education"~
-Mark Twain
Re: Formula Cars "Editor" in game [Re: Germanunkol] #110821
02/21/07 07:54
02/21/07 07:54
Joined: Oct 2005
Posts: 4,771
Bay City, MI
lostclimate Offline
Expert
lostclimate  Offline
Expert

Joined: Oct 2005
Posts: 4,771
Bay City, MI
@ germanunkol it appears he is just using a box model, yes, but you could also do this with line drawing features real easily.

Re: Formula Cars "Editor" in game [Re: lostclimate] #110822
02/21/07 10:56
02/21/07 10:56
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline
Expert
Germanunkol  Offline
Expert

Joined: Jun 2006
Posts: 2,640
Earth
http://img19.imageshack.us/my.php?image=navigationsystem02wt2.png

I did it with particles. (move flag on, streak flag off)

What do you mean "line drawing features"?

I'd really like to know how he changes the size of the "selection box" to fit the current selection... if he does...

Micha


~"I never let school interfere with my education"~
-Mark Twain
Re: Formula Cars "Editor" in game [Re: PHeMoX] #110823
02/21/07 14:12
02/21/07 14:12
Joined: Mar 2005
Posts: 514
Brazil
Carloos Offline OP
User
Carloos  Offline OP
User

Joined: Mar 2005
Posts: 514
Brazil
Quote:

Quote:

* Click in 2D and get 3D cordinates is still bad, but works when you get the hummm hand on it... ( Maybe someone has a point and select script ? )




What's exactly your problem with this? Are you not getting the right 3D positions?

Using the following line should give you the exact 3D coordinates of a click:
Code:

var pos1;
var pos2;
pos1.x = mouse_pos.x;
pos1.y = mouse_pos.y;
pos1.z = 0;//0
vec_for_screen(pos1, camera);
pos2.x = mouse_pos.x;
pos2.y = mouse_pos.y;
pos2.z = 100000; //20000 use a big value here
vec_for_screen(pos2, camera);
trace_mode = ignore_passable + ignore_Sprites + ignore_models;
target =0;
c_trace(pos1, pos2,trace_mode);


After that simply save the 'target' it will return and use it.


Cheers




Thankyou for point me this, PHeMox, thats exactly what i´m doing.

But, instead of give me the exact clicked place, it gets me in the TARGET vector a place in between the camera and the place I had clicked. I got tired of trying tons of changes on it... so I decided to go ahead with the tool and maybe get some help from the community to correct this later.

Re: Formula Cars "Editor" in game [Re: Germanunkol] #110824
02/21/07 14:17
02/21/07 14:17
Joined: Mar 2005
Posts: 514
Brazil
Carloos Offline OP
User
Carloos  Offline OP
User

Joined: Mar 2005
Posts: 514
Brazil
Quote:

Hey, that's very cool.
I'm wondering: How did you do the "corners" if the selected unit?
Are they just another model? Looks like it... but then how do you set it to be exactly the size your selected object? Or don't you?





I make a loop through the entity vertices, and get theyr x,y,z lower and higher positions, from what I get its real rendered dimensions. Then I compare it with a model , 64 quants squared ( Its a model, AlphaChannel skin... ) and adapt its scale to fit exactly the model size. The result isnt perfect all times, anyway.

When making scaling calculations, I set the Pan/tilt/roll to Zero of both entities, to get exact or ( something so ) results, them I put them back to the original position.

When I get home I will post this simple code.

About maps, I think will not work with them.

Thankyou GermanUnkol

Last edited by Carloos; 02/21/07 14:18.
Re: Formula Cars "Editor" in game [Re: Carloos] #110825
02/21/07 15:49
02/21/07 15:49
Joined: Sep 2002
Posts: 8,177
Netherlands
PHeMoX Offline
Senior Expert
PHeMoX  Offline
Senior Expert

Joined: Sep 2002
Posts: 8,177
Netherlands
Quote:

Thankyou for point me this, PHeMox, thats exactly what i´m doing.




Your welcome. Well, the only thing that I had problems with was when I used this code but not used c_trace. Do you use c_trace too? If so, then I'm not sure what's wrong hehehe,

Cheers


PHeMoX, Innervision Software (c) 1995-2008

For more info visit: Innervision Software
Re: Formula Cars "Editor" in game [Re: PHeMoX] #110826
02/21/07 17:41
02/21/07 17:41
Joined: Oct 2005
Posts: 4,771
Bay City, MI
lostclimate Offline
Expert
lostclimate  Offline
Expert

Joined: Oct 2005
Posts: 4,771
Bay City, MI
for line drawing use these functions:

rel_to_screen (VECTOR* vector, VIEW* view);
draw_line(VECTOR*, COLOR*, var alpha)

look the up in the manual to see exactly how to use them, all you'd have to do is take a invisible box model scale it up and vec_lerp the distance between all 8 vertices to about 20% and draw from the vertex to that point

edit: Also carlos, sorry for hijacking your thread, the game looks, nice, i like the editor, and i have no idea how to fix your problem cuz that is how i would have done it too

Last edited by lostclimate; 02/21/07 17:42.
Re: Formula Cars "Editor" in game [Re: lostclimate] #110827
02/21/07 18:15
02/21/07 18:15
Joined: Mar 2005
Posts: 514
Brazil
Carloos Offline OP
User
Carloos  Offline OP
User

Joined: Mar 2005
Posts: 514
Brazil
PheMox :

I´m using C-Trace, and also cant understand why the result isnt perfect. Anyway... Thankyou for your tips and interest.

Lostclimate :

Dont need to sorry , your tip is very relevant to my project. Never used vec_lerp, I will study it to learn how to use it.

Formula Cars Editor Screenshot [Re: Carloos] #110828
02/25/07 22:08
02/25/07 22:08
Joined: Mar 2005
Posts: 514
Brazil
Carloos Offline OP
User
Carloos  Offline OP
User

Joined: Mar 2005
Posts: 514
Brazil
Hi.

I´m just finishing the work for the in game editor i´m using in Formula Cars game, and just made this screenshot, I changed the style a lot and placed the editor panel in the left side of the screen.

The object spawner opens a secondary little window with options to set, not yet finished, but close to it..



I already made an improvment with corners "drag´n drop" style control to set the region limits of the objects to be spawned. Interesting that after develop with some functionalities in mind, I ended up with some I didnt planned but worked also nice, as an example, the hability of move the corners of the selected regions also in the control panel :



The code inside the tool is interesting also to study and see how some functionalities were achieved, so I think this tool altought simple can be very usefull not only to populate or even build complete model only levels, but also to new people to learn.

This tool will be basically free for use, and I´m already setting a C-Lite converted one to contribute.

Page 4 of 8 1 2 3 4 5 6 7 8

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