by SanDiego1 » Mon Mar 20, 2006 3:30 am
Hi Ericdg -
I figured out how to incorporate the getOwner into the RPN module/game.
Here's what you do:
Create a global string variable. I named it "ownerData" and saved it into the "owner" group.
Incorporate the RPN module into your game. Once that is done, in the "regsubmit" actor, go to Mouse Down event and then script. You need to add a strcpy line for the owner information and a strcmp line.
The first few lines of the NEW script will read:
transp=0.99;
strcpy(regcode,GetUnlockKey(rpnstring,regname));
strcpy(ownerData, getOwner());
// Must match, have at least 5 characters in name and the reg code should be 5 digits, too
if (strcmp(regcode,regaskcode)==0 && strcmp(regname,ownerData)==0 && strlen(regname)>6 && strlen(regcode)==5)
{
//Show "Thank you" sign!
thankyou.x=0; thankyou.y=0;
EventDisable("keyboard.0",EVENTALL);
EventDisable("keyboard.1",EVENTALL);
ETC.
The new code is "strcpy(ownerData, getOwner());" AND "strcmp(regname,ownerData)==0"
I made it so the minimum letters in the regname had to be six, not five. (You can make this whatever you want but I found it didn't work if you made it a precise number.) Also, I have found that once I incorporated this code into my game, I couldn't go to game preview and enter a name to get through the registration process. Even if I exported it to my PC, I still couldn't get through the registration process on my PC. The only way I could look at the game was downloading it to my PPC.
Hope this helps.