Gamestudio Links
Zorro Links
Newest Posts
zorro license, IB connection
by AndrewAMD. 12/06/23 17:16
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
5 registered members (AndrewAMD, miwok, TipmyPip, 3run, 1 invisible), 631 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
empty pointer ?? #265510
05/12/09 20:34
05/12/09 20:34

C
chris_oat
Unregistered
chris_oat
Unregistered
C



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: ] #265513
05/12/09 20:46
05/12/09 20:46
Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
maybe player is empty?


3333333333
Re: empty pointer ?? [Re: ] #265515
05/12/09 20:49
05/12/09 20:49
Joined: May 2008
Posts: 331
Lithuania, Vilnius
Jaxas Offline
Senior Member
Jaxas  Offline
Senior Member

Joined: May 2008
Posts: 331
Lithuania, Vilnius
try use:
action name()
{
....
}


The smaller the bug, the harder it is to kill.
_________________________________________
Forklift DEMO (3dgs)
Re: empty pointer ?? [Re: Jaxas] #265516
05/12/09 20:50
05/12/09 20:50
Joined: May 2008
Posts: 331
Lithuania, Vilnius
Jaxas Offline
Senior Member
Jaxas  Offline
Senior Member

Joined: May 2008
Posts: 331
Lithuania, Vilnius
as Quadraxas said, do you have this line "ENTITY* player_weapon"?


The smaller the bug, the harder it is to kill.
_________________________________________
Forklift DEMO (3dgs)
Re: empty pointer ?? [Re: Jaxas] #265517
05/12/09 21:04
05/12/09 21:04

C
chris_oat
Unregistered
chris_oat
Unregistered
C



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

C
chris_oat
Unregistered
chris_oat
Unregistered
C



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 Offline
Senior Expert
Quad  Offline
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

C
chris_oat
Unregistered
chris_oat
Unregistered
C



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

C
chris_oat
Unregistered
chris_oat
Unregistered
C



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);
}
}

Re: empty pointer ?? [Re: ] #265783
05/14/09 06:40
05/14/09 06:40
Joined: Apr 2009
Posts: 298
Southern Oceans
KiwiBoy Offline
Member
KiwiBoy  Offline
Member

Joined: Apr 2009
Posts: 298
Southern Oceans
HAve you placed your own numbers there or not?
e.g. vec_for_vertex (my.skill1, you, 949);
vec_for_vertex (my.skill4, you, 1110);

If not, then you need to make sure the vertices numbers are from the model you are using as the player.
One will be at bottom of palm, the other around the thumb or first knuckle so that the weapon stays in place at all times.

Personally, Id rather model the weapon into the characters anims then hide it when its not needed by shrinking it or deleting it from the timeline.


Use the 'manual' Luke, the manual is your friend. 'Self reminder' smile

My WebPage
Page 1 of 2 1 2

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