Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 10/25/26 03:42
Chat Room for Zorro Programmers
by Haitao_Ren. 10/25/26 03:14
Trading Journey
by Haitao_Ren. 10/25/26 03:14
Algorithmic trading course with Zorro
by Haitao_Ren. 10/25/26 03:12
Zorro tutorial ideas?
by Haitao_Ren. 10/25/26 02:47
Zorro plugin for Hyperliquid.xyz
by mayarik. 10/24/26 09:14
Tradestation missing in table of contents
by AndrewAMD. 10/23/26 14:35
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
3 registered members (3run, TipmyPip, opm), 7,722 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Haitao_Ren, JimSimons, julienp, julienper, KelleyAbbey
19247 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Empty Pointer #89208
09/09/06 08:34
09/09/06 08:34
Joined: Apr 2006
Posts: 37
Swiss
M
mfuada Offline OP
Newbie
mfuada  Offline OP
Newbie
M

Joined: Apr 2006
Posts: 37
Swiss
Hi..
What kind of mistake that usually cause the Empty pointer error...
beside forget to put the "wait(1)" line...

Re: Empty Pointer [Re: mfuada] #89209
09/09/06 11:53
09/09/06 11:53
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
If the empty pointer happens at game start:
A function/action trys to access a pointer which is not set yet.
This happens, because some entities are created before others.
So lets say the enemie accesses the player pointer in his action while loop.
But because he is created earlier (for any reason) he gets an empty pointer and you as a developer an empty pointer error.
This can be sorted out by simply adding another while loop _before_ the main while loop in the entities action.
If we use the example from above, we would change our enemies action to something like this:
Code:

action enemie_act
{
while(!player) { wait(1); } //waits until the player pointer is none zero (!=0)
while(my.health > 0)
{
...




Gamestudio download | 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