Plug-in question: how to report win,... Log Out | Topics | Search
Moderators | Register | Edit Profile

Zillions of Games Discussion Forum » Designing Games for Zillions » Plug-in question: how to report win, loss, or draw « Previous Next »

Author Message
John Pritchett (John_Pritchett)
Posted on Monday, June 16, 2003 - 6:47 pm:   

In my plug-in, I'm attempting to report a win, Loss, or draw via the DLL_IsGameOver exported routine. I pass back WIN_SCORE, LOSS_SCORE, or DRAW_SCORE depending on the outcome of my game, and fill the zComment buffer with a description of the result. Zillions displays the correct dialog indicating the result, but when I press OK, it then brings up another dialog stating that the game is a draw. This is because it calls my DLL_GenerateMoves routine and gets zero moves back (since the game is over). Why does Zillions check for more moves if IsGameOver returns a value to indicate that an end condition has been reached? If this is not the proper way to indicate win, loss, or draw, what should I be doing?

Thanks!
Jeff Mallett (Jeffm)
Posted on Friday, July 04, 2003 - 2:52 pm:   

John, it sounds like a Zillions bug, but I can't see why that would happen looking at the Zillions code. If you zip up your .DLL, .ZRF, and the necessary graphics and email them to me, I'd be happy to debug it in Zillions. Thanks.
Cameron Browne (Camb)
Posted on Thursday, July 31, 2003 - 11:43 am:   

I've found the same problem. If you change DLL_IsGameOver in the sample RandomGoMoku.c code to a trivial win (eg win if play at gBoard[0]) then the win is recognised, but the "Stalemate: Draw!" message follows immediately.

I like the way Zillions recognises wins both in the engine and the rules file. Nice!

Also: LibMain never seems to get called, contrary to the documentation, but everything still seems to work okay.
Greg Schmidt (Gschmidt)
Posted on Tuesday, February 21, 2006 - 10:18 am:   

[Also: LibMain never seems to get called, contrary to the documentation, but everything still seems to work okay. ]

OK, I realize I'm responding to this almost three years later, but I just encountered the same problem so I thought I'd post the resolution.

The problem is that LibMain is valid for Win16, but not for Win32. In that case you need to specify DllMain (see below). Don't forget to add DllMain to the list of exports too.

BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved ) {

/* ... */

return TRUE;
}

-- Greg

Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action: