Difference between revisions of "Troubleshooting Modules"

From ASSS Wiki
Jump to: navigation, search
(added knowledge)
 
Line 44: Line 44:
 
Only the core header files are in asss.h, and you will need to manually include any others.
 
Only the core header files are in asss.h, and you will need to manually include any others.
 
This may also be true if you are using a custom interface.
 
This may also be true if you are using a custom interface.
 +
 +
 +
== Why does my module keep crashing when a player leaves the zone? ==
 +
 +
You may be saving the player pointer somewhere, and then are trying to access it after the player leaves.
 +
This does not work because the pointer becomes invalid when the player leaves.
 +
Your module is informed when this happens by the CB_NEWPLAYER callback.
  
  
 
[[Category:Module]]
 
[[Category:Module]]
 
[[Category:Guides]]
 
[[Category:Guides]]

Revision as of 19:37, 6 January 2011

Here are some general solutions to help you solve a problem with a module that you just wrote. Keep in mind that these are suggestions, and may not always be correct.


My module works when I put it in modules.conf, but the zone crashes when I use ?insmod, why?

Chances are, you are doing something in the CB_ARENAACTION callback, and are doing something in the AA_PRECREATE or AA_CREATE states. Simply do this when the module loads:

Arena *a;
Link *link;
aman->Lock();
FOR_EACH_ARENA(a)
{
	ArenaAction(a,AA_PRECREATE);
	ArenaAction(a,AA_CREATE);
}
aman->Unlock();


When my module is in modules.conf, players can not enter the zone, or when I use ?insmod, players can not switch arenas and I get errors about player states!

You may be using arena data improperly. Be sure you have gotten the I_ARENAMAN interface and have used AllocateArenaData() properly.


My module keeps failing to load!

Be sure you have all the necessary modules needed for your module to run. Make sure your module loads after the modules it is dependant on are already loaded.


My module crashes whenever I try to use an interface!

Make sure you have gotten the interface by using GetInterface(). You may have forgotten to check if your interface is valid. (like if(!iface) return MM_FAIL;)


My module will not compile! Why can't my compiler find certain things?

Sometimes, #include asss.h is not enough. Only the core header files are in asss.h, and you will need to manually include any others. This may also be true if you are using a custom interface.


Why does my module keep crashing when a player leaves the zone?

You may be saving the player pointer somewhere, and then are trying to access it after the player leaves. This does not work because the pointer becomes invalid when the player leaves. Your module is informed when this happens by the CB_NEWPLAYER callback.