Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
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
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
3 registered members (TedMar, AndrewAMD, fairtrader), 578 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
empty pointer help... #134936
06/09/07 15:17
06/09/07 15:17
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline OP

Expert
Blink  Offline OP

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
my code has no errors, but when its run in the level, why do i get an empty pointer error, when i click ok, it runs perfectly? can someone look at this code and see something I dont see?

Code:
string ventesc_wmb = <ventesc.wmb>; 

action level_changer
{
while (vec_dist (my.x, plBiped01_entity.x) > 100) {wait (1);} // wait until the player has come close enough
plBiped01_entity = me;
my = null; // keep the function running even after level_load
level_load (ventesc_wmb);
wait (3); // wait until the level is loaded
media_play ("1meetz.mpg", null, 100); // now play the movie
}



Re: empty pointer help... [Re: Blink] #134937
06/09/07 15:26
06/09/07 15:26
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
tompo Offline
User
tompo  Offline
User

Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
first write
plBiped01_entity = me;
then
while (vec_dist (my.x, plBiped01_entity.x) > 100) {wait (1);} // wait until the player has come close enough

becouse in this case in first cycle You have empty pointer... with next one problem dissapear because program knows that plBiped01_entity = me;


Never say never.
Re: empty pointer help... [Re: tompo] #134938
06/09/07 17:53
06/09/07 17:53
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
No plBiped01_entity will be set by the templates tompo!!

Just write the following line at the beginning of your action:
while(!plBiped01_entity) { wait(1); }

This while loop makes sure that the plBiped01_entity has been created.

EDIT:
Blink your code does not make sense.
First you assign the plBiped01_entity pointer to that action and then set the my pointer to null.
You should try this script instead:
Code:

string ventesc_wmb = <ventesc.wmb>;

action level_changer
{
while(!plBiped01_entity) { wait(1); }
while (vec_dist (my.x, plBiped01_entity.x) > 100) {wait (1);} // wait until the player has come close enough
my = null; // keep the function running even after level_load
level_load (ventesc_wmb);
wait (3); // wait until the level is loaded
media_play ("1meetz.mpg", null, 100); // now play the movie
}


However I'm not sure if actions can have a "my = null;"

Last edited by Xarthor; 06/09/07 17:55.
Re: empty pointer help... [Re: Xarthor] #134939
06/09/07 19:02
06/09/07 19:02
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
tompo Offline
User
tompo  Offline
User

Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
true wait for plBiped01_entity
so if(plBiped01_entity != 0){do something to avoid empty pointer}
else{wait(1);}

my bad or to much % in my blood

Last edited by tompo; 06/09/07 19:03.

Never say never.
Re: empty pointer help... [Re: tompo] #134940
06/11/07 11:25
06/11/07 11:25
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline OP

Expert
Blink  Offline OP

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
my movie wouldnt show without the my = null; for some reason. when i put it back, it ran perfectly, thanks for the assist, guys!


My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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