|
|
radar question
#129692
05/13/07 19:00
05/13/07 19:00
|
Joined: Nov 2005
Posts: 1,007
jigalypuff
OP
Serious User
|
OP
Serious User
Joined: Nov 2005
Posts: 1,007
|
just wondering, i know it is possible to have a radar bmap which shows the whole level, is it also possible to be able to click on that map so you would go to were you clicked? thanks in advance.
Why does everyone like dolphins?
Never trust a species which smiles all the time!
|
|
|
Re: radar question
[Re: jigalypuff]
#129693
05/13/07 19:05
05/13/07 19:05
|
Joined: Mar 2007
Posts: 776 Poor village - Poland ;)
tompo
User
|
User
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
|
you have to use second view then place it by function on screen were you want to. camera should be ofcourse haigh above and looking straight down. You may use Noparticle = on; noshadow = on; etc. to improve framerate and looking about click and go... hmmm... change main camera pos to clicked position? maybe trace from second camera to mouse pos on the ground and then go there? Just suggestion 
Last edited by tompo; 05/13/07 19:09.
|
|
|
Re: radar question
[Re: tompo]
#129694
05/13/07 20:00
05/13/07 20:00
|
Joined: Nov 2005
Posts: 1,007
jigalypuff
OP
Serious User
|
OP
Serious User
Joined: Nov 2005
Posts: 1,007
|
well i have an isometric camera already and am trying to use the rader code from the aums, but am getting sedloads of errors, i think it may be old syntax so i`ll have to keep fiddeling with it.
Why does everyone like dolphins?
Never trust a species which smiles all the time!
|
|
|
Re: radar question
[Re: jigalypuff]
#129695
05/13/07 20:42
05/13/07 20:42
|
Joined: May 2004
Posts: 1,510 Denmark
Claus_N
Serious User
|
Serious User
Joined: May 2004
Posts: 1,510
Denmark
|
Code:
//////////////////////////////////////////////////// function set_pos(); bmap temp_map = <black.tga>; //////////////////////////////////////////////////// view radar_view { layer = 1; size_x = 320; size_y = 240; flags = visible; } panel radar_pan { bmap = temp_map; flags = transparent,visible; alpha = 0; // Invisible on_click = set_pos; } //////////////////////////////////////////////////// function set_pos() { temp.x = mouse_pos.x - radar_pan.pos_x; temp.y = mouse_pos.y - radar_pan.pos_y; temp.z = 0; vec_set(target,temp); target.z = mouse_range; vec_for_screen(temp,radar_view); vec_for_screen(target,radar_view); c_trace(temp,target,ignore_passable + ignore_models); if(vec_dist(target,nullvector) > 0) { vec_set(camera.x,target); } } //////////////////////////////////////////////////// function init_radar() { radar_view.z = 1000; radar_view.tilt = -90; radar_pan.size_x = radar_view.size_x; radar_pan.size_y = radar_view.size_y; } ////////////////////////////////////////////////////
Remember to call function init_radar  Hope that's what you need  The bmap used could be any bmap - it would not be visible anyways.
|
|
|
Re: radar question
[Re: Claus_N]
#129696
05/13/07 22:17
05/13/07 22:17
|
Joined: Nov 2005
Posts: 1,007
jigalypuff
OP
Serious User
|
OP
Serious User
Joined: Nov 2005
Posts: 1,007
|
well the code works and it`s very close to what i`m after, but the map view don`t appear to be a view of the level,  the effect i want is more like this one  that panel pops up when i click on the helmsman, if thats the rader then i can click on were on the map i want the ship to go, and if possible to use different icons for my ship and enemy ships. i don`t have a block around the level though, is this why the view is not of the level?
Why does everyone like dolphins?
Never trust a species which smiles all the time!
|
|
|
Re: radar question
[Re: jigalypuff]
#129697
05/14/07 07:14
05/14/07 07:14
|
Joined: May 2004
Posts: 1,510 Denmark
Claus_N
Serious User
|
Serious User
Joined: May 2004
Posts: 1,510
Denmark
|
You can set x, y, z, pan, tilt and roll of the view, just like camera ("camera" is also just a view). You can set pos_x and pos_y to place it where you want on the screen, and size_x and size_y to set the size. The panel, radar_pan, should just cover the view - it is the panel that you click on, as a view does not have an on_click event.
If there is no geometry in the level, the set-player-to-clicked-position code would not work, as it uses a trace.
And the "vec_set(camera.x,target);" after the trace should be "vec_set(player.x,target);".
|
|
|
|