|
|
Re: strange error message
[Re: Dega]
#350782
12/19/10 01:19
12/19/10 01:19
|
Joined: Oct 2007
Posts: 5,209 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
|
so what about that error message? what kind of error do you get?
Last edited by Quadraxas; 12/19/10 01:19.
3333333333
|
|
|
Re: strange error message
[Re: Quad]
#350783
12/19/10 01:26
12/19/10 01:26
|
Joined: Dec 2010
Posts: 100
Dega
OP
Member
|
OP
Member
Joined: Dec 2010
Posts: 100
|
That was an error message that appeared on the game screen and then somehow let the game start anyways when i entered this code for trying to get my problem solved. I apologize for not posting it earlier. Here it is and let me know if u need to see more code or if u can tell what should be done:
action monster_ai() { c_scan(me.x,360,vector(360,360,0),IGNORE_ME); }
action operate_monsters_act() { grav_rule_act(); monster_ai(); }
action operate_player_act() { stand_player_act(); grav_rule_act(); move_forward_act(); turnl_act(); turnr_act(); camera_folo_func(); move_back_act(); }
function main() { level_load("prototype.wmb"); ent_create("player.mdl",vector(150,400,-400),operate_player_act); ent_create("demon.mdl",vector(300,-1500,-395),operate_monsters_act); }
boolean my.awesomeness = so true;
|
|
|
Re: strange error message
[Re: Dega]
#350785
12/19/10 01:57
12/19/10 01:57
|
Joined: Dec 2010
Posts: 100
Dega
OP
Member
|
OP
Member
Joined: Dec 2010
Posts: 100
|
Also it said:SYS_CRASH:monster_ai();
boolean my.awesomeness = so true;
|
|
|
Re: strange error message
[Re: Spirit]
#350834
12/19/10 15:52
12/19/10 15:52
|
Joined: Dec 2010
Posts: 100
Dega
OP
Member
|
OP
Member
Joined: Dec 2010
Posts: 100
|
Thank you for that piece of code it got rid of the error message and game works fine however I have a new question. How would you get the monster entity to face my player? I'm trying to get it to where he always runs to the player until colliding. I would appreciate any suggestions and here is all my code:
var walk_perc_var; var max_hp_var = 100; var health_var = max_hp_var;
STRING* health_str = "HP - ";
TEXT* health_txt = { pos_x = 0; pos_y = 0; string(health_str); font = "ARIAL#18"; flags = SHOW; }
PANEL* health_pan = { digits(32,0,4,"ARIAL#18",1,health_var); flags = SHOW; }
action grav_rule_act() { while(1) { c_move(me,vector(0,0,-2),NULL,GLIDE); wait(1); } }
function camera_folo_func() { while(1) { vec_set(camera.x,vector(-150,0,150)); vec_rotate(camera.x,me.pan); vec_add(camera.x,me.x); vec_set(camera.pan,vector(me.pan,-20,0)); wait(1); } }
action stand_player_act() { while(1) { while(!on_anykey) { ent_animate(me,"stand 0",walk_perc_var,ANM_CYCLE); walk_perc_var += 10 * time_step; wait(1); } } }
action turnr_act() { while(1) { while(key_cur) { my.pan -= 10*time_step; wait(1); } wait(1); } }
action turnl_act() { while(1) { while(key_cul) { my.pan += 10*time_step; wait(1); } wait(1); } }
action move_back_act() { while(1) { while(key_cud) { ent_animate(me,"walk",walk_perc_var,ANM_CYCLE); walk_perc_var += 10 * time_step; c_move(me,vector(-15*time_step,0,0),NULL,GLIDE); wait(1); } wait(1); } }
action move_forward_act() { while(1) { while(key_cuu) { ent_animate(me,"walk",walk_perc_var,ANM_CYCLE); walk_perc_var += 10 * time_step; c_move(me,vector(15*time_step,0,0),NULL,GLIDE); wait(1); } wait(1); } }
action monster_ai() { while(!me) { c_scan(me.x,360,vector(360,360,0),IGNORE_ME); } }
action operate_monsters_act() { grav_rule_act(); monster_ai(); }
action operate_player_act() { stand_player_act(); grav_rule_act(); move_forward_act(); turnl_act(); turnr_act(); camera_folo_func(); move_back_act(); }
function main() { level_load("prototype.wmb"); ent_create("player.mdl",vector(150,400,-400),operate_player_act); ent_create("demon.mdl",vector(300,-1500,-395),operate_monsters_act); }
boolean my.awesomeness = so true;
|
|
|
Re: strange error message
[Re: Dega]
#350960
12/20/10 16:42
12/20/10 16:42
|
Joined: Jul 2005
Posts: 1,002 Trier, Deutschland
Nowherebrain
Serious User
|
Serious User
Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
|
that is a bunch of actions...try using only 2 actions....
1 for the player, and one for the enemy. if you are going to call on piece of code repeatedly by different entities, like gravity for instance. You can set that in a separate "function" and then call that from the entity actions. If you do not understand what I mean, than you should go through the workshops again....also read the AUM's starting from around 67 or so....I think that is when lite-c was launched...correct me if I am wrong.
Last edited by Nowherebrain; 12/20/10 16:51.
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|