3 registered members (NnamueN, Akow, 1 invisible),
1,421
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: battle of smielys
[Re: Random]
#389096
12/10/11 15:04
12/10/11 15:04
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
OK, I got the movement stuff. Found few bugs: * camera is jerking sometimes (got this only two times, can't recreate) * jerking movement, caused by bullets I guess (have no other ideas) All other ways, it looks great
|
|
|
Re: battle of smielys
[Re: JoGa]
#389232
12/11/11 21:24
12/11/11 21:24
|
Joined: Feb 2010
Posts: 886
Random
OP
User
|
OP
User
Joined: Feb 2010
Posts: 886
|
danger-icon? good idea ^^ I thought about adding a troll in my game, but that did not really fit Now I am almost finished with adding some cars. After that, there will be planes (jets or what ever).
|
|
|
Re: battle of smielys
[Re: Random]
#389240
12/11/11 23:33
12/11/11 23:33
|
Joined: Feb 2010
Posts: 886
Random
OP
User
|
OP
User
Joined: Feb 2010
Posts: 886
|
Hy again. I have a little problem with my car... I looked for a long time for the reason, why the car is not driving. There are no warnings, errors or other stuff. The problem I am having is that the car just not react when I press W,S,A or D. Could somebody please tell me were the problem is? Code; var constr_front_left; var constr_front_right;
var constr_back_left; var constr_back_right;
VECTOR mom_speed; var max_angle; var stear_contr;
var max_speed = 1500; var ang_force; var speed_contr;
function mass() { pXent_setmass(my,60); pXent_setfriction (my, 100); pXent_setdamping (my, 20, 20); pXent_setelasticity (my,20); }
action warthdog() { pXent_settype(my,PH_RIGID,PH_CONVEX); pXent_setmass (my, 15);
pXent_setfriction (my, 20); pXent_setdamping (my, 5, 5); pXent_setelasticity (my, 10);
ENTITY* constr_front_left = ent_create("tire.mdl",vector(my.x+75,my.y-45,my.z-10),mass); ENTITY* constr_front_right = ent_create("tire.mdl",vector(my.x+75,my.y+45,my.z-10),mass); ENTITY* constr_back_left = ent_create("tire.mdl",vector(my.x-70,my.y-45,my.z-10),mass); ENTITY* constr_back_right = ent_create("tire.mdl",vector(my.x-70,my.y+45,my.z-10),mass); pXcon_add ( PH_WHEEL, constr_front_left, my, 0 ); pXcon_add ( PH_WHEEL, constr_front_right, my, 0 ); pXcon_add ( PH_WHEEL, constr_back_left, my, 0 ); pXcon_add ( PH_WHEEL, constr_back_right, my, 0 ); while(1) { stear_contr = (key_d - key_a); max_angle += stear_contr * 3 * time_step; max_angle = clamp (max_angle, -30, 30); if (stear_contr != 0) { pXcon_setparams2 (constr_front_left, vector (max_angle, max_angle, 0), nullvector, vector (95000, 500, 0)); pXcon_setparams2 (constr_front_right, vector (max_angle, max_angle, 0), nullvector, vector (95000, 500, 0)); } else { max_angle = max_angle * (1 - (0.25 * time_step)); if (abs(max_angle) < 1) max_angle = 0; pXcon_setparams2 (constr_front_left, vector (max_angle, max_angle, 0), nullvector, vector (95000, 500, 0)); pXcon_setparams2 (constr_front_right, vector (max_angle, max_angle, 0), nullvector, vector (95000, 500, 0)); } speed_contr = (key_w - key_s); ang_force = speed_contr * 1000 * time_step;
pXcon_setmotor(constr_back_left, vector(-ang_force, max_speed, 0), nullvector); pXcon_setmotor(constr_back_right, vector(-ang_force, max_speed, 0), nullvector); wait(1); } } } Thank you future more.
Last edited by Random; 12/11/11 23:37.
|
|
|
Re: battle of smielys
[Re: Random]
#389296
12/12/11 21:45
12/12/11 21:45
|
Joined: Feb 2010
Posts: 886
Random
OP
User
|
OP
User
Joined: Feb 2010
Posts: 886
|
Ok I found out. Take a look if your interested in it, it works fine function mass() { while(you) { pXent_setmass(my,60); pXent_setfriction (my, 100); pXent_setdamping (my, 20, 20); pXent_setelasticity (my,20); //pXent_addforcecentral (my,vector(0,0,2000)); wait(1); } pXent_addvelcentral(my,vector(-2000 + random(4000),-2000 + random(4000),2000 + random(4000))); pXent_settype(my,PH_RIGID,PH_CONVEX); wait(-20); ent_remove(my); }
action warthdog() { c_setminmax(my);
pXent_settype(my,PH_RIGID,PH_CONVEX); pXent_setmass (my, 15);
pXent_setfriction (my, 20); pXent_setdamping (my, 5, 5); pXent_setelasticity (my, 10);
ENTITY* FLwheel = ent_create("tire.mdl",vector(my.x+75,my.y-45,my.z-20),mass); ENTITY* FRwheel = ent_create("tire.mdl",vector(my.x+75,my.y+45,my.z-20),mass); ENTITY* BLwheel = ent_create("tire.mdl",vector(my.x-70,my.y-45,my.z-20),mass); ENTITY* BRwheel = ent_create("tire.mdl",vector(my.x-70,my.y+45,my.z-20),mass); pXcon_add ( PH_WHEEL, FLwheel, my, 0 ); pXcon_add ( PH_WHEEL, FRwheel, my, 0 ); pXcon_add ( PH_WHEEL, BLwheel, my, 0 ); pXcon_add ( PH_WHEEL, BRwheel, my, 0 ); pXcon_setparams2 (FLwheel, NULL, vector(62, 100, 0), vector(500, 100, 4)); pXcon_setparams2 (FRwheel, NULL, vector(62, 100, 0), vector(500, 100, 4)); pXcon_setparams2 (BLwheel, NULL, vector(150, 300, 0), vector(500, 100, 4)); pXcon_setparams2 (BRwheel, NULL, vector(150, 300, 0), vector(500, 100, 4)); while(1) { var speed=0; var lenk=0; speed=clamp(speed,-10000,10000); lenk=clamp(lenk,-45,45); if(key_w) { speed-=1000; } else if(key_w==0) speed+=1000; if(key_s) { speed+=1000; } if(key_a) { lenk-=5; } if(key_d) { lenk+=5; } pXcon_setwheel (FLwheel,lenk,0,0); pXcon_setwheel (FRwheel,lenk,0,0); pXcon_setwheel (BLwheel,0,speed,0); pXcon_setwheel (BRwheel,0,speed,0);
pXent_addvelcentral(my,vector(0,0,-10));
if(key_shift) { pXcon_setwheel (BLwheel,0,0,5000); pXcon_setwheel (BRwheel,0,0,5000); } } wait(1); } } greetings ^^
Last edited by Random; 12/12/11 21:46.
|
|
|
Re: battle of smielys
[Re: 3run]
#389383
12/13/11 18:32
12/13/11 18:32
|
Joined: Feb 2010
Posts: 886
Random
OP
User
|
OP
User
Joined: Feb 2010
Posts: 886
|
With traces. The AI drives towards the enemy (furthermore it will be a base), and jump of it there are near enough. But if they are driving and trace something, he will turn either left or right until the trace hits nothing anymore. I have another little question. I notice that "ent_next" uses all entities. Which means, that in the example below, every entity with "entity_typ = 3" becomes invisible. But I want that only the nearest entity with "entity_typ = 3" becomes invisible. Also the entity should become visible again, if it is not the nearest entity with "entity_typ = 3" anymore. example: for (you = ent_next(NULL); you != NULL; you = ent_next(you)) { if ((you != my) && (you.entity_typ == 3)) { set(you,INVISIBLE); } else { reset(my,INVISIBLE); } } Does anyone know how to do that?
Last edited by Random; 12/13/11 18:37.
|
|
|
Re: battle of smielys
[Re: Random]
#390022
12/21/11 15:26
12/21/11 15:26
|
Joined: Feb 2010
Posts: 886
Random
OP
User
|
OP
User
Joined: Feb 2010
Posts: 886
|
Please, test battle of smilies test 2Replay, if you find any bugs or stuff like that, please. Next will be, ais in cars
|
|
|
Re: battle of smielys
[Re: Random]
#406025
08/12/12 20:46
08/12/12 20:46
|
Joined: Feb 2010
Posts: 886
Random
OP
User
|
OP
User
Joined: Feb 2010
Posts: 886
|
I redeveloped battle of smilies, now it is called "smiley wars" ^^ New AI: AI battle test And more exotic AI to come: dragon test reviews please ^^
Last edited by Random; 08/12/12 20:47.
|
|
|
|