1 registered members (TipmyPip),
18,618
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Model on top of the panel
[Re: RyuMaster]
#225760
09/05/08 22:33
09/05/08 22:33
|
Joined: Jul 2007
Posts: 959 nl
flits
User
|
User
Joined: Jul 2007
Posts: 959
nl
|
cant you just give the mdoel a higher layer
doesnt it need to be ENTITY* ent1 = ... flags2 = ...;
"empty"
|
|
|
Re: Model on top of the panel
[Re: Rasch]
#225763
09/05/08 22:45
09/05/08 22:45
|
Joined: Aug 2006
Posts: 155
RyuMaster
OP
Member
|
OP
Member
Joined: Aug 2006
Posts: 155
|
Lite-C. Dah... Many problems I having are because lite-c and c-script are mixed at the manual.
What kills me not, that makes me stronger.
***Working on RPG/RTS***
|
|
|
Re: Model on top of the panel
[Re: RyuMaster]
#225764
09/05/08 22:48
09/05/08 22:48
|
Joined: Aug 2006
Posts: 155
RyuMaster
OP
Member
|
OP
Member
Joined: Aug 2006
Posts: 155
|
"""ENTITY* ent1 = ... flags2 = ...;"''
No matter what layer I set, or VISIBLE or not, if I create entity with not "ent_create", I can not see it. I do not know, why.
What kills me not, that makes me stronger.
***Working on RPG/RTS***
|
|
|
Re: Model on top of the panel
[Re: RyuMaster]
#225770
09/05/08 22:58
09/05/08 22:58
|
Joined: Aug 2006
Posts: 155
RyuMaster
OP
Member
|
OP
Member
Joined: Aug 2006
Posts: 155
|
That it was I use. In Lite-C, I can not even use "visible", only VISIBLE. Else I get an error.
What kills me not, that makes me stronger.
***Working on RPG/RTS***
|
|
|
Re: Model on top of the panel
[Re: Rasch]
#225774
09/05/08 23:06
09/05/08 23:06
|
Joined: Aug 2006
Posts: 155
RyuMaster
OP
Member
|
OP
Member
Joined: Aug 2006
Posts: 155
|
Yes, sure. And the other way around. Well, I'll try it one more time, maybe I missed something...
What kills me not, that makes me stronger.
***Working on RPG/RTS***
|
|
|
Re: Model on top of the panel
[Re: RyuMaster]
#225778
09/05/08 23:14
09/05/08 23:14
|
Joined: Aug 2006
Posts: 155
RyuMaster
OP
Member
|
OP
Member
Joined: Aug 2006
Posts: 155
|
No problem, it is the mess anyway  Here is what I have so far: #include <acknex.h> #include <default.c> VECTOR trace_coords; PANEL* compass_pan = { bmap = "point1.bmp"; pos_x = 0; pos_y = 40; layer =-1; flags = VISIBLE;
} ENTITY ent1 = { type = "robotic.mdl"; layer = 200; // display above view entities with layer 1 //view = camera; flags2 = VISIBLE; client_id = camera; // same camera parameters as the default view flags = VISIBLE; x = 300; // place 100 quants ahead of the view y = 0; // 50 to the right z = 0; // and center vertically } TEXT* debugtext = { layer = 1; pos_x = 200; pos_y = 200; size_y = 40; offset_y = 0; string ("collision"); flags = CENTER_X | NARROW | TRANSPARENT | VISIBLE; } action hand_action() { while (1) { var tempx; var tempy;
tempx = mouse_pos.x; tempy = mouse_pos.y; my.pan += 5*(key_a-key_d)*time_step; me.x = you.x; me.y = you.y; me.z = you.z + 10; set(my,PASSABLE);
mouse_calm =20; // 10 Pixels aren't movement! if (my.skill1 > 0 && !mouse_force.y && !mouse_left) { my.skill1 -= 10*time_step; ent_animate(me,"back",my.skill1,ANM_CYCLE); } if(mouse_left) { if (mouse_moving) { my.pan += mouse_force.x * 20; } if (mouse_force.y) { my.skill1 += 10*time_step; if (my.skill1 > 80) my.skill1 = 80; ent_animate(me,"back",my.skill1,ANM_CYCLE);
}
} else {
if (my.pan != you.pan) { if (my.pan - you.pan < 10 && my.pan - you.pan > - 10) {
my.pan = you.pan; } else if (my.pan - you.pan > 10) {
my.pan-=10; } else {
my.pan+=10; } } }
wait(1); } }
action player_walk() { // if necessary, adjust the bounding box to give the entity 'floor room' (see remarks) // my.min_z *= 0.5;
var speed_down = 0; // downward speed by gravity var anim_percent = 0; // animation percentage VECTOR vFeet; vec_for_min(vFeet,me); // vFeet.z = distance from player origin to lowest vertex ent_create("robotichand.mdl", vector(my.x,my.y,my.z), hand_action); // assumes you're using cbabe set(me,SHADOW); // you may want shadows ??
while (1) {
//if (mouse_left) //{ // if (c_trace(my.x,vector(my.x,my.y + 10,my.z),IGNORE_ME | IGNORE_PASSABLE | USE_BOX) > 0) // { // you.y = me.y; // } //}
trace_coords.x = 100; trace_coords.y = 0; trace_coords.z = 0; // vec_set(trace_coords.x, vector(10, 0, 0);
vec_rotate(trace_coords.x, my.pan);
vec_add(trace_coords.x, my.x);
c_trace(my.x, trace_coords.x, IGNORE_ME | IGNORE_PASSABLE);
if (!you) // hit a wall? {
str_cpy((debugtext.pstring)[0], "NO!");
} else { str_cpy((debugtext.pstring)[0], "YES!"); }
if(key_t) // X pressed { camera.x+=20; wait(3); } if(key_g) // X pressed { camera.x-=20; wait(3); } if(key_f) // X pressed { camera.z+=20; wait(3); } if(key_h) // X pressed { camera.z-=20; wait(3); } if(key_p) // X pressed { camera.pan+=1; wait(3); } if(key_l) // X pressed { camera.tilt+=1; wait(3); } // rotate the player using the [A] and [D] keys my.pan += 5*(key_a-key_d)*time_step;
// determine the ground distance by a downwards trace var dist_down; if (c_trace(my.x,vector(my.x,my.y,my.z-5000),IGNORE_ME | IGNORE_PASSABLE | USE_BOX) > 0) dist_down = my.z + vFeet.z - target.z; // get distance between player's feet and the ground else dist_down = 0;
// apply gravity when the player is in the air if (dist_down > 0) // above floor, fall down with increasing speed dist_down = clamp(dist_down,0,accelerate(speed_down,5,0.1)); else // on or below floor, set downward speed to zero speed_down = 0;
// move the player using the [W] and [S] keys var dist_ahead = 5*(key_w-key_s)*time_step; dist_ahead = sign(dist_ahead)*(abs(dist_ahead) + 0.5*dist_down); // adapt the speed on slopes c_move(me,vector(dist_ahead,0,0),vector(0,0,-dist_down),IGNORE_PASSABLE | GLIDE); // move the player
// animate the player according to its moved distance if (dist_ahead != 0) // player is moving ahead { anim_percent += 1.3*dist_ahead; // 1.3 = walk cycle percentage per quant ent_animate(me,"walk",anim_percent,ANM_CYCLE); // play the "walk" animation } else // player stands still { anim_percent += 1*time_step; ent_animate(me,"still",anim_percent,ANM_CYCLE); // play the "stand" animation } wait(1); } } action face_camera() { while (1) { //my.roll = camera.roll; my.pan = camera.pan - 180; my.tilt = camera.tilt; wait(1); } }
function main() // start of program { video_mode = 8; //video_screen =1;
shadow_stencil = 2;
wait(1);
level_load("");
wait(2); camera.arc = 35; ent_create("robotic.mdl", vector(300,0,0), player_walk); // assumes you're using cbabe ent_create("box.mdl", vector(300,50,0), NULL); // assumes you're using cbabe //ent_create("point1.bmp", vector(895,0,0), face_camera); // assumes you're using cbabe
camera.tilt = -16; camera.pan = 5; camera.z = 100;
// camera.pos_x = 200; // move the camera together with the player entity //camera.pan = 175.964; // vec_set(camera.pan,player.pan); //handle = media_loop("miami.mp3",NULL,20); // how about some nice music, 20 = vol level video_window(NULL,NULL,0,"My simple demo game"); // change the window text from GameStudio }
What kills me not, that makes me stronger.
***Working on RPG/RTS***
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|