|
|
empty pointer ??
#265510
05/12/09 20:34
05/12/09 20:34
|
chris_oat
Unregistered
|
chris_oat
Unregistered
|
hi leute / hi guys,
ich habe schon wieder ein problem. und zwar habe ich folgendes Sript (wdl):
action make_gun{
my.passable = on; my.shadow = on; while(my){wait(1); proc_late(); my.x = camera.x; my.y = camera.y; my.z = camera.z; my.pan = camera.pan; my.tilt = camera.tilt; vec_for_vertex(shotspot,player_weapon,15); if(mouse_left&&trigger==0){ camera.x += random(3); camera.y += random(3); //camera.z += random(3); ent_create("bullet.mdl", camera.x,make_bullet);trigger=1; } if(mouse_left==0){trigger = 0;} } }
action gun_pu{//Asign this to the gun model in WED while(vec_dist(my.x,player.x)>75){wait(1);} player_weapon = ent_Create("shotgun.mdl", camera.x, make_gun); ent_remove(me); }
wenn ich die engine starte, kommt die fehlermeldung " empty pointer in action gun_pu " Könnt ihr mir helfen?
English: Hi there, im useing this script above, and i get an error saying "empty pointer in action gun_pu " can u help?
|
|
|
Re: empty pointer ??
[Re: Jaxas]
#265517
05/12/09 21:04
05/12/09 21:04
|
chris_oat
Unregistered
|
chris_oat
Unregistered
|
This is my currently player script:
action player_action //main player { wait(1); player = me; my.narrow = on; smooth_shadow(); //vec_for_min(boden,me); on_space = door_check; loadControlsDefault(); //this sets up controls and assigns keys...uses the new template misc_input file initCameras(); camActive = 1; cameraMove(); ent_create (knife_mdl, my.x, attach_knife); // put this line in your player's action //player.items = 0; while(player) { if (c_trace(my.x,vector(my.x,my.y,my.z-5000),IGNORE_ME | IGNORE_PASSABLE | USE_BOX) > 0) { }
if(freeze_mode == 0) { playerIntentions(); //get input environmentForces(); //calculate calculateForces(); // forces animatePlayer(); //animate player based on state } wait(1); } }
is there something missing? and YES i have entity* player_weapon;
Last edited by chris_oat; 05/12/09 21:09.
|
|
|
Re: empty pointer ??
[Re: ]
#265519
05/12/09 21:18
05/12/09 21:18
|
chris_oat
Unregistered
|
chris_oat
Unregistered
|
Emtpy poiner in: gun_pu (vec_dist(my.x,player.x)>75){wait(1);}
|
|
|
Re: empty pointer ??
[Re: ]
#265524
05/12/09 21:44
05/12/09 21:44
|
Joined: Oct 2007
Posts: 5,209 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
|
either player or my is null, show us where you call/use gun_pu
3333333333
|
|
|
Re: empty pointer ??
[Re: Quad]
#265527
05/12/09 21:56
05/12/09 21:56
|
chris_oat
Unregistered
|
chris_oat
Unregistered
|
yeah, i just add this line and now its working without errro;
action gun_pu(){//Asign this to the gun model in WED while (player == null) {wait (1);} while(vec_dist(my.x, player.x)>75){wait(1);} player_weapon = ent_Create("shotgun.mdl", camera.x, make_gun); ent_remove(me); }
.. BUT the gun not appear in the player hands:( What i do wrong here i hope u can help?
PS: I also tried this code: (here neither, gun is not in players hand upon pickup)
action knife_pu(){//Asign this to the gun model in WED while (player == null) {wait (1);} while(vec_dist(my.x, player.x)>75){wait(1);} player_weapon = ent_Create("knife.mdl", my.x, attach_knife2); ent_remove(me); }
function attach_knife2() { proc_late(); my.passable = on; // the sword shouldn't slow down the player my.shadow = on; while (you != null) { vec_for_vertex (my.skill1, you, 949); vec_for_vertex (my.skill4, you, 1110); vec_diff (my.skill7, my.skill4, my.skill1); vec_to_angle (my.pan, my.skill7); vec_set (my.x, my.skill1); wait (1); } }
Last edited by chris_oat; 05/13/09 08:04.
|
|
|
Re: empty pointer ??
[Re: ]
#265773
05/14/09 06:02
05/14/09 06:02
|
chris_oat
Unregistered
|
chris_oat
Unregistered
|
WHO CAN HELP ME ON THIS!
i use this code below for picking up gun or knife whatever, but the item just wont appear in the players hand...
action knife_pu(){//Asign this to the gun model in WED while (player == null) {wait (1);} while(vec_dist(my.x, player.x)>75){wait(1);} player_weapon = ent_Create("knife.mdl", my.x, attach_knife2); ent_remove(me); }
function attach_knife2() { proc_late(); my.passable = on; // the sword shouldn't slow down the player my.shadow = on; while (you != null) { vec_for_vertex (my.skill1, you, 949); vec_for_vertex (my.skill4, you, 1110); vec_diff (my.skill7, my.skill4, my.skill1); vec_to_angle (my.pan, my.skill7); vec_set (my.x, my.skill1); wait (1); } }
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|