Page 1 of 1

How to integrate getOwner() into RPN module?

PostPosted: Mon Mar 06, 2006 7:09 am
by ericdg
Would it be complicated to integrate this new feature into the current RPN module by beyondthetech and dark.

Would getOwner() work for smartphone as well as pocket pc?

Re: How to integrate getOwner() into RPN module?

PostPosted: Tue Mar 07, 2006 1:14 pm
by makslane
ericdg wrote:Would it be complicated to integrate this new feature into the current RPN module by beyondthetech and dark


The getOwner() function returns a text, so, you can put the returned text in code, like this:

strcpy(name, getOwner());

Would getOwner() work for smartphone as well as pocket pc?


Yes, it works in both systems

getOwner in RPN module

PostPosted: Mon Mar 20, 2006 3:30 am
by SanDiego1
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.