Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,014 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Conversion help liteC #394414
02/12/12 23:53
02/12/12 23:53
Joined: Feb 2012
Posts: 17
1
1525252 Offline OP
Newbie
1525252  Offline OP
Newbie
1

Joined: Feb 2012
Posts: 17
I have this code custom made for my old proj. by Claus N. aka Nighhawk.Can you convert it to liteC. I am not familiar with programing and need this quickly. If it`s not a big trouble ,do it please. This is the only one code i need for whole project.
Beside... HELLO to 3dgs comunity again laugh
This code do:
- right click = show mouse pointer and stop camera(player) folow mouse
- when right click on specific model = panel is shown
- on panel buttons left click = change curent model with another one
- panel gone, new model replace the old one, mouse pointer gone
- wsad+mouse movements (player invisible, walk on the ground and colide with walls & models),implemented when no right click.


Code:
/////////////////////////////////////////
// Player Selection/Switching script
// 
// (c) 2006 by Claus N.
// Nighthawk Arts
// www.nighthawk.dk
/////////////////////////////////////////
define anim_state,skill21;
define active,flag1;

//////////////////////////////////////////
// Define all your animation states below
define state_stand,0;
define state_walk,1;
define state_run,2;
define state_spin,3;
define state_bounce,4;
//////////////////////////////////////////
// Animation names
string anim_stand = "stand";
string anim_walk = "walk";
string anim_run = "run";
string anim_spin = "attack";
string anim_bounce = "bounce";
/////////////////////////////////////////
// Pictures
bmap selBG_map = <backg.tga>;
bmap but1_map = <but1.tga>;
bmap but2_map = <but2.tga>;
bmap but3_map = <but3.tga>;
bmap but4_map = <but4.tga>;
bmap but5_map = <but5.tga>;
bmap butc_map = <cancel.tga>;
bmap but1_over_map = <but1-h.tga>;
bmap but2_over_map = <but2-h.tga>;
bmap but3_over_map = <but3-h.tga>;
bmap but4_over_map = <but4-h.tga>;
bmap but5_over_map = <but5-h.tga>;
bmap butc_over_map = <cancel-h.tga>;
/////////////////////////////////////////
// Sounds
sound pl1_snd = <click.wav>;
sound pl2_snd = <click.wav>;
sound pl3_snd = <click.wav>;
sound pl4_snd = <click.wav>;
sound pl5_snd = <click.wav>;
sound cancel_snd = <click.wav>;
sound pl1_over_snd = <flop.wav>;
sound pl2_over_snd = <flop.wav>;
sound pl3_over_snd = <flop.wav>;
sound pl4_over_snd = <flop.wav>;
sound pl5_over_snd = <flop.wav>;
sound cancel_over_snd = <flop.wav>;
sound ent_rightclick = <click.wav>;
sound ent_leftclick = <click.wav>;
sound sound_on_q = <q.wav>;
sound sound_on_e = <e.wav>;
sound sound_on_idle = <idle.wav>;
/////////////////////////////////////////
// Models
string pl1_mdl = <FromBack.mdl>;
string pl2_mdl = <ride.mdl>;
string pl3_mdl = <Tpose.mdl>;
string pl4_mdl = <Tpose.mdl>;
string pl5_mdl = <Tpose.mdl>;
/////////////////////////////////////////
var_nsave snd_handle;
var actorHandle;
/////////////////////////////////////////
string level_str = <level.wmb>;
/////////////////////////////////////////
function butOver(but,pan);
function butClick(but,pan);
/////////////////////////////////////////
panel selectionPan
{
bmap = selBG_map;
flags = refresh;
button = 20,30,but1_map,but1_map,but1_over_map,butClick,null,butOver;
button = 20,60,but2_map,but2_map,but2_over_map,butClick,null,butOver;
button = 20,90,but3_map,but3_map,but3_over_map,butClick,null,butOver;
button = 20,120,but4_map,but4_map,but4_over_map,butClick,null,butOver;
button = 20,150,but5_map,but5_map,but5_over_map,butClick,null,butOver;
button = 20,180,butc_map,butc_map,butc_over_map,butClick,null,butOver;
}
/////////////////////////////////////////
function butOver(but,pan)
{
if(snd_handle != 0)
{
snd_stop(snd_handle);
}
if(but == 1) {snd_handle = snd_play(pl1_over_snd,100,10);}
if(but == 2) {snd_handle = snd_play(pl2_over_snd,100,10);}
if(but == 3) {snd_handle = snd_play(pl3_over_snd,100,10);}
if(but == 4) {snd_handle = snd_play(pl4_over_snd,100,10);}
if(but == 5) {snd_handle = snd_play(pl5_over_snd,100,10);}
if(but == 6) {snd_handle = snd_play(cancel_over_snd,100,10);}
}
/////////////////////////////////////////
function butClick(but,pan)
{
mouse_mode = 0;

if(actorHandle == 0) {return;}
you = ptr_for_handle(actorHandle);
actorHandle = 0;
if(!you) {return;}

if(snd_handle != 0)
{
snd_stop(snd_handle);
}
if(but == 1) {snd_handle = snd_play(pl1_snd,100,10);ent_morph(you,pl1_mdl);}
if(but == 2) {snd_handle = snd_play(pl2_snd,100,10);ent_morph(you,pl2_mdl);}
if(but == 3) {snd_handle = snd_play(pl3_snd,100,10);ent_morph(you,pl3_mdl);}
if(but == 4) {snd_handle = snd_play(pl4_snd,100,10);ent_morph(you,pl4_mdl);}
if(but == 5) {snd_handle = snd_play(pl5_snd,100,10);ent_morph(you,pl5_mdl);}
if(but == 6) {snd_handle = snd_play(cancel_snd,100,10);}
selectionPan.visible = off;
wait(2);
mouse_mode = 0;

}
/////////////////////////////////////////

function init_mouse()
{
	if((mouse_pos.x < selectionPan.pos_x
	|| mouse_pos.x > selectionPan.pos_x + bmap_width(selectionPan.bmap))
	|| (mouse_pos.y < selectionPan.pos_y
	|| mouse_pos.y > selectionPan.pos_y + bmap_height(selectionPan.bmap)))
	{
		selectionPan.visible = off;
	}
	wait(1);
	mouse_toggle();
}

/////////////////////////////////////////
function selPan_Show(ent)
{
if(ent == 0) {return;}
you = ptr_for_handle(ent);
if(!you) {return;}

temp.x = you.x;
temp.y = you.y;
temp.z = you.z + you.min_z;

vec_to_screen(temp,camera);

selectionPan.pos_x = clamp(temp.x,0,screen_size.x - bmap_width(selectionPan.bmap));
selectionPan.pos_y = clamp(temp.y,0,screen_size.y - bmap_height(selectionPan.bmap));

actorHandle = ent;

selectionPan.visible = on;
}
/////////////////////////////////////////
function animateMe()
{
while(my)
{
if(my.anim_state == state_stand)
{
ent_animate(my,anim_stand,my.skill46,ANM_CYCLE);
my.skill46 += 10 * time;
}
if(my.anim_state == state_walk)
{
ent_animate(my,anim_walk,my.skill46,ANM_CYCLE);
my.skill46 += 6 * time;
}
if(my.anim_state == state_run)
{
ent_animate(my,anim_run,my.skill46,ANM_CYCLE);
my.skill46 += 10 * time;
}
if(my.anim_state == state_spin)
{
ent_animate(my,anim_spin,my.skill46,ANM_CYCLE);
my.skill46 += 8 * time;
}
if(my.anim_state == state_bounce)
{
ent_animate(my,anim_bounce,my.skill46,ANM_CYCLE);
my.skill46 += 8 * time;
}
my.skill46 %= 100;
wait(1);
}
}
/////////////////////////////////////////
function actorClicked
{
if(snd_handle != 0)
{
snd_stop(snd_handle);
}

if(event_type == event_rightclick)
{
snd_handle = snd_play(ent_rightclick,100,10);
selPan_Show(handle(my));
wait(1);
mouse_mode = 2;
mouse_on();
}
if(event_type == event_click)
{
snd_handle = snd_play(ent_leftclick,100,10);
while(mouse_left) {wait(1);}
my.active = on;
while(!mouse_left) {wait(1);}
my.active = off;
}
}
/////////////////////////////////////////
function mtl_xzmaterijal_init
{
vec_set(mtl.emissive_blue,mat_model.emissive_blue);
vec_set(mtl.ambient_blue,mat_model.ambient_blue);
vec_set(mtl.diffuse_blue,mat_model.diffuse_blue);
vec_set(mtl.specular_blue,mat_model.specular_blue);
mtl.power=mat_model.power;
mtl.albedo=mat_model.albedo;
mtl.skill1=pixel_for_vec(vector(0,0,0),0,8888);
}

material mtl_xzmaterijal
{
event=mtl_xzmaterijal_init;
effect=
"
texture entSkin1;
dword mtlSkill1;

technique xzmaterijal
{
pass p0
{
Texture[0]=<entSkin1>;
ZWriteEnable=True;
AlphaBlendEnable=True;//was False
AlphaTestEnable=True;
AlphaRef=<mtlSkill1>;
AlphaFunc=Greater;
CullMode=CCW;

ColorArg1[0]=Texture;
ColorOp[0]=Modulate2X;
ColorArg2[0]=Diffuse;
}
}
technique fallback{pass p0{}}
";
}
/////////////////////////////////////////
action entity_slct
{
	my.material=mtl_xzmaterijal;
	animateMe();
	my.enable_click = on;
	my.enable_rightclick = on;
	my.event = actorClicked;
	while(my)
	{
		if(my.active)
		{
			my.ambient = 10;
			my.anim_state = state_stand;
			
			if(key_q)
			{
				my.anim_state = state_spin;
				snd_stop(my.skill22);
				if(!snd_playing(my.skill32))
				{
					my.skill32 = snd_loop(sound_on_q,100,10);
				}
			}
			else
			{
				if(key_e)
				{
					my.anim_state = state_run;
					snd_stop(my.skill22);
					if(!snd_playing(my.skill32))
					{
						my.skill32 = snd_loop(sound_on_e,100,10);
					}
				}
				else
				{
					snd_stop(my.skill32);
					if(!snd_playing(my.skill22))
					{
						my.skill22 = snd_loop(sound_on_idle,100,10);
					}
				}
			}
		}
		else
		{
			snd_stop(my.skill22);
			snd_stop(my.skill32);
			my.ambient = 0;
			my.anim_state = state_stand;
		}
		wait(1);
	}
}

/////////////////////////////////////////
on_mouse_right = init_mouse;
/////////////////////////////////////////
function check_panel()
{
	if((mouse_pos.x < selectionPan.pos_x
	|| mouse_pos.x > selectionPan.pos_x + bmap_width(selectionPan.bmap))
	|| (mouse_pos.y < selectionPan.pos_y
	|| mouse_pos.y > selectionPan.pos_y + bmap_height(selectionPan.bmap)))
	{
		selectionPan.visible = off;
	}
}
function init_mouse()
{
	check_panel();
	wait(1);
	mouse_toggle();
}
/////////////////////////////////////////
 
on_mouse_left = init_mouse;

[b][/b]

Re: Conversion help liteC [Re: 1525252] #394417
02/13/12 00:29
02/13/12 00:29
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Code:
/////////////////////////////////////////
// Player Selection/Switching script
// 
// (c) 2006 by Claus N.
// Nighthawk Arts
// www.nighthawk.dk
/////////////////////////////////////////
#include <default.c>

#define anim_state skill21
#define active flag1

//////////////////////////////////////////
// Define all your animation states below
#define state_stand 0
#define state_walk 1
#define state_run 2
#define state_spin 3
#define state_bounce 4
//////////////////////////////////////////
// Animation names
STRING* anim_stand = "stand";
STRING* anim_walk = "walk";
STRING* anim_run = "run";
STRING* anim_spin = "attack";
STRING* anim_bounce = "bounce";
/////////////////////////////////////////
// Pictures
BMAP* selBG_map = "backg.tga";
BMAP* but1_map = "but1.tga";
BMAP* but2_map = "but2.tga";
BMAP* but3_map = "but3.tga";
BMAP* but4_map = "but4.tga";
BMAP* but5_map = "but5.tga";
BMAP* butc_map = "cancel.tga";
BMAP* but1_over_map = "but1-h.tga";
BMAP* but2_over_map = "but2-h.tga";
BMAP* but3_over_map = "but3-h.tga";
BMAP* but4_over_map = "but4-h.tga";
BMAP* but5_over_map = "but5-h.tga";
BMAP* butc_over_map = "cancel-h.tga";
/////////////////////////////////////////
// Sounds
SOUND* pl1_snd = "click.wav";
SOUND* pl2_snd = "click.wav";
SOUND* pl3_snd = "click.wav";
SOUND* pl4_snd = "click.wav";
SOUND* pl5_snd = "click.wav";
SOUND* cancel_snd = "click.wav";
SOUND* pl1_over_snd = "flop.wav";
SOUND* pl2_over_snd = "flop.wav";
SOUND* pl3_over_snd = "flop.wav";
SOUND* pl4_over_snd = "flop.wav";
SOUND* pl5_over_snd = "flop.wav";
SOUND* cancel_over_snd = "flop.wav";
SOUND* ent_rightclick = "click.wav";
SOUND* ent_leftclick = "click.wav";
SOUND* sound_on_q = "q.wav";
SOUND* sound_on_e = "e.wav";
SOUND* sound_on_idle = "idle.wav";
/////////////////////////////////////////
// Models
STRING* pl1_mdl = "FromBack.mdl";
STRING* pl2_mdl = "ride.mdl";
STRING* pl3_mdl = "Tpose.mdl";
STRING* pl4_mdl = "Tpose.mdl";
STRING* pl5_mdl = "Tpose.mdl";
/////////////////////////////////////////
var snd_handle;
var actorHandle;
/////////////////////////////////////////
STRING* level_str = "level.wmb";
/////////////////////////////////////////
function butOver(but,pan);
function butClick(but,pan);
/////////////////////////////////////////
PANEL* selectionPan =
{
bmap = selBG_map;
button = 20,30,but1_map,but1_map,but1_over_map,butClick,null,butOver;
button = 20,60,but2_map,but2_map,but2_over_map,butClick,null,butOver;
button = 20,90,but3_map,but3_map,but3_over_map,butClick,null,butOver;
button = 20,120,but4_map,but4_map,but4_over_map,butClick,null,butOver;
button = 20,150,but5_map,but5_map,but5_over_map,butClick,null,butOver;
button = 20,180,butc_map,butc_map,butc_over_map,butClick,null,butOver;
}
/////////////////////////////////////////
function butOver(but,pan)
{
if(snd_handle != 0)
{
snd_stop(snd_handle);
}
if(but == 1) {snd_handle = snd_play(pl1_over_snd,100,10);}
if(but == 2) {snd_handle = snd_play(pl2_over_snd,100,10);}
if(but == 3) {snd_handle = snd_play(pl3_over_snd,100,10);}
if(but == 4) {snd_handle = snd_play(pl4_over_snd,100,10);}
if(but == 5) {snd_handle = snd_play(pl5_over_snd,100,10);}
if(but == 6) {snd_handle = snd_play(cancel_over_snd,100,10);}
}
/////////////////////////////////////////
function butClick(but,pan)
{
mouse_mode = 0;

if(actorHandle == 0) {return;}
you = ptr_for_handle(actorHandle);
actorHandle = 0;
if(!you) {return;}

if(snd_handle != 0)
{
snd_stop(snd_handle);
}
if(but == 1) {snd_handle = snd_play(pl1_snd,100,10);ent_morph(you,pl1_mdl);}
if(but == 2) {snd_handle = snd_play(pl2_snd,100,10);ent_morph(you,pl2_mdl);}
if(but == 3) {snd_handle = snd_play(pl3_snd,100,10);ent_morph(you,pl3_mdl);}
if(but == 4) {snd_handle = snd_play(pl4_snd,100,10);ent_morph(you,pl4_mdl);}
if(but == 5) {snd_handle = snd_play(pl5_snd,100,10);ent_morph(you,pl5_mdl);}
if(but == 6) {snd_handle = snd_play(cancel_snd,100,10);}
reset(selectionPan,SHOW);
wait(2);
mouse_mode = 0;

}
/////////////////////////////////////////

function mouse_toggle() // switches the mouse on and off
{  
  if (mouse_mode >= 2) { // was it already on?
    mouse_mode = 0;
  } else {
    mouse_mode = 2; 
  } 
  while (mouse_mode > 0) // move it over the screen
  {  
    vec_set(mouse_pos,mouse_cursor);
    wait(1);
  }
}

function init_mouse()
{
	if((mouse_pos.x < selectionPan.pos_x
	|| mouse_pos.x > selectionPan.pos_x + bmap_width(selectionPan.bmap))
	|| (mouse_pos.y < selectionPan.pos_y
	|| mouse_pos.y > selectionPan.pos_y + bmap_height(selectionPan.bmap)))
	{
		reset(selectionPan,SHOW);
	}
	wait(1);
	mouse_toggle();
}

/////////////////////////////////////////
function selPan_Show(ent)
{
if(ent == 0) {return;}
you = ptr_for_handle(ent);
if(!you) {return;}
VECTOR temp;
temp.x = you.x;
temp.y = you.y;
temp.z = you.z + you.min_z;

vec_to_screen(temp,camera);

selectionPan.pos_x = clamp(temp.x,0,screen_size.x - bmap_width(selectionPan.bmap));
selectionPan.pos_y = clamp(temp.y,0,screen_size.y - bmap_height(selectionPan.bmap));

actorHandle = ent;
set(selectionPan,SHOW);
}
/////////////////////////////////////////
function animateMe()
{
while(my)
{
if(my.anim_state == state_stand)
{
ent_animate(my,anim_stand,my.skill46,ANM_CYCLE);
my.skill46 += 10 * time_step;
}
if(my.anim_state == state_walk)
{
ent_animate(my,anim_walk,my.skill46,ANM_CYCLE);
my.skill46 += 6 * time_step;
}
if(my.anim_state == state_run)
{
ent_animate(my,anim_run,my.skill46,ANM_CYCLE);
my.skill46 += 10 * time_step;
}
if(my.anim_state == state_spin)
{
ent_animate(my,anim_spin,my.skill46,ANM_CYCLE);
my.skill46 += 8 * time_step;
}
if(my.anim_state == state_bounce)
{
ent_animate(my,anim_bounce,my.skill46,ANM_CYCLE);
my.skill46 += 8 * time_step;
}
my.skill46 %= 100;
wait(1);
}
}
/////////////////////////////////////////
function actorClicked()
{
if(snd_handle != 0)
{
snd_stop(snd_handle);
}

if(event_type == EVENT_RIGHTCLICK)
{
snd_handle = snd_play(ent_rightclick,100,10);
selPan_Show(handle(my));
wait(1);
mouse_mode = 2;
if (!mouse_mode)
	mouse_toggle();
}
if(event_type == EVENT_CLICK)
{
snd_handle = snd_play(ent_leftclick,100,10);
while(mouse_left) {wait(1);}
set(me,FLAG1);
while(!mouse_left) {wait(1);}
reset(me,FLAG1);
}
}
/////////////////////////////////////////
function mtl_xzmaterijal_init()
{
vec_set(mtl.emissive_blue,mat_model.emissive_blue);
vec_set(mtl.ambient_blue,mat_model.ambient_blue);
vec_set(mtl.diffuse_blue,mat_model.diffuse_blue);
vec_set(mtl.specular_blue,mat_model.specular_blue);
mtl.power=mat_model.power;
mtl.albedo=mat_model.albedo;
mtl.skill1=pixel_for_vec(vector(0,0,0),0,8888);
}

MATERIAL* mtl_xzmaterijal =
{
event=mtl_xzmaterijal_init;
effect=
"
texture entSkin1;
dword mtlSkill1;

technique xzmaterijal
{
pass p0
{
Texture[0]=<entSkin1>;
ZWriteEnable=True;
AlphaBlendEnable=True;//was False
AlphaTestEnable=True;
AlphaRef=<mtlSkill1>;
AlphaFunc=Greater;
CullMode=CCW;

ColorArg1[0]=Texture;
ColorOp[0]=Modulate2X;
ColorArg2[0]=Diffuse;
}
}
technique fallback{pass p0{}}
";
}
/////////////////////////////////////////
action entity_slct()
{
	my.material=mtl_xzmaterijal;
	animateMe();
	my->emask |= (ENABLE_CLICK | ENABLE_RIGHTCLICK);
	my.event = actorClicked;
	while(my)
	{
		if(is(my,FLAG1))
		{
			my.ambient = 10;
			my.anim_state = state_stand;
			
			if(key_q)
			{
				my.anim_state = state_spin;
				snd_stop(my.skill22);
				if(!snd_playing(my.skill32))
				{
					my.skill32 = snd_loop(sound_on_q,100,10);
				}
			}
			else
			{
				if(key_e)
				{
					my.anim_state = state_run;
					snd_stop(my.skill22);
					if(!snd_playing(my.skill32))
					{
						my.skill32 = snd_loop(sound_on_e,100,10);
					}
				}
				else
				{
					snd_stop(my.skill32);
					if(!snd_playing(my.skill22))
					{
						my.skill22 = snd_loop(sound_on_idle,100,10);
					}
				}
			}
		}
		else
		{
			snd_stop(my.skill22);
			snd_stop(my.skill32);
			my.ambient = 0;
			my.anim_state = state_stand;
		}
		wait(1);
	}
}

/////////////////////////////////////////
on_mouse_right = init_mouse;
/////////////////////////////////////////
function check_panel()
{
	if((mouse_pos.x < selectionPan.pos_x
	|| mouse_pos.x > selectionPan.pos_x + bmap_width(selectionPan.bmap))
	|| (mouse_pos.y < selectionPan.pos_y
	|| mouse_pos.y > selectionPan.pos_y + bmap_height(selectionPan.bmap)))
	{
		reset(selectionPan,SHOW);
	}
}
function init_mouse()
{
	check_panel();
	wait(1);
	mouse_toggle();
}
/////////////////////////////////////////
 
on_mouse_left = init_mouse;




Always learn from history, to be sure you make the same mistakes again...
Re: Conversion help liteC [Re: Uhrwerk] #394424
02/13/12 06:45
02/13/12 06:45
Joined: Feb 2012
Posts: 17
1
1525252 Offline OP
Newbie
1525252  Offline OP
Newbie
1

Joined: Feb 2012
Posts: 17
Thanks Uhrwerk laugh , i`ll guess it`s working , because no error when run project.

I have another problem. I can`t move or click with mouse to test the code.
That code was runing atached to a5 template project (with invisible cbabe.mdl as "player_walk_fight" behaviour).

- Now, i need simple "wsad-fps-with collision" code atached to some model to use player selection script.
my main.c looks like this:
Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>
#include <mtlFX.c>
#include <selpann.c>
///////////////////////
//   2012 test  //
//////////////////////

BMAP* mice = "mice.tga";

void main() 
{
  video_mode = 8;
  video_depth = 32;
  video_switch(0,0,2);	
  wait(3);
  level_load("level.wmb");
  wait(3);
  mouse_map = mice;
}



Re: Conversion help liteC [Re: 1525252] #394432
02/13/12 09:25
02/13/12 09:25
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
hi,
it should help:
mouse_mode = 1;
while(1)
{
vec_set(mouse_pos,mouse_cursor);
wait(1);
}



Free world editor for 3D Gamestudio: MapBuilder Editor
Re: Conversion help liteC [Re: sivan] #394445
02/13/12 12:26
02/13/12 12:26
Joined: Feb 2012
Posts: 17
1
1525252 Offline OP
Newbie
1525252  Offline OP
Newbie
1

Joined: Feb 2012
Posts: 17
No,sorry, it won`t work.I tried.
With this i have mouse pointer at start and that i don`t need.
Also, right click= show panel work only one time, then i have system hand pointer. No right click= show panel anymore.
Maybe, this is some error in player_selection script.

Let me explain precise what i need:

1. wsad+mouse player move action (attached to eg.cube.mdl),
2. only when i press rigt mouse button = show pointer ( no panel),
3. mouse over entity right click = show panel
4. left click on panel button = change mdl, close panel, pointer gone.
5. wsad+mouse player move again until right mouse click.

Could someone write this for me (wsad) in main.c and fix mouse problem in main.c or plselect.c. I ave no idea, is it dificult or not?
Thanks!

Re: Conversion help liteC [Re: 1525252] #394468
02/13/12 15:39
02/13/12 15:39
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Why don't you give this a try for yourself or post in the Jobs Offered Forum?


Always learn from history, to be sure you make the same mistakes again...
Re: Conversion help liteC [Re: Uhrwerk] #394473
02/13/12 16:26
02/13/12 16:26
Joined: Feb 2012
Posts: 17
1
1525252 Offline OP
Newbie
1525252  Offline OP
Newbie
1

Joined: Feb 2012
Posts: 17
I tried something like this for camera movement (copy/paste from other people tutorials laugh ). This camera code is from some physic tutorial, but still don`t have "action" for model and no collision.I have no clue how to manage that.
Project is working and i can move, but NO Right click = show mouse...etc.

I am an 3d animator & modeler, have no knowledge in programing. I asume that this is a few lines to add, but i do not know how to do it. Please help.

Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>
#include <mtlFX.c>
#include <sel_pan.c> //Uhrwerk rewrited code for player selection in liteC
//////////////////
//   2012 test  //
//////////////////

BMAP* mice = "mice.tga";

void camera_load(a,b,c,d);

void main() 
{
  video_mode = 8;
  video_depth = 32;
  video_switch(0,0,2);	
  wait(3);
  level_load("level.wmb");
  wait(3);
  mouse_map = mice;

  camera_load(0,0,100,1);

}

VECTOR vSpeed, vAngularSpeed, vForce, vMove;

void camera_load(a,b,c,d)
{
	camera.x=a;
	camera.y=b;
	camera.z=c;
	var birim;
	birim=6;
	
	if(d==1)
	{
		while (1) 
		{
			if(key_shiftl==1)
			{
				birim=26;
			}
			else
			{
				birim=16;
			}
			vForce.x = -5*(key_force.x + mouse_force.x);	// pan angle
			vForce.y = 5*(key_force.y + mouse_force.y);	// tilt angle
			vForce.z = 0;	// roll angle
			vec_accelerate(vMove,vAngularSpeed,vForce,0.8);
			vec_add(camera.pan,vMove);		

			vForce.x = birim * (key_w - key_s);		// forward
			vForce.y = birim * (key_a - key_d);		// sideward
			vForce.z = birim * (key_home - key_end);	// upward
			vec_accelerate(vMove,vSpeed,vForce,0.5);
			vec_rotate(vMove,camera.pan);
			vec_add(camera.x,vMove);
			wait(1);
			
		}
	}

}




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