a question

Talk about making games.

a question

Postby jj2197 » Wed Feb 09, 2005 4:04 am

I know how to catch two keys in a sequence. But can you catch as many keys in a sequence as you want.If yes, than can you tell me how to.

I'm new to game editor.
User avatar
jj2197
 
Posts: 51
Joined: Sun Feb 06, 2005 10:01 am
Location: St. george
Score: 0 Give a positive score

Postby willg101 » Wed Feb 09, 2005 10:14 pm

I don't know either! I have the same question.
http://www.wish-games.com
Old betas now available!!
User avatar
willg101
 
Posts: 473
Joined: Thu Dec 16, 2004 12:08 am
Location: West Michigan
Score: 5 Give a positive score

Postby makslane » Fri Feb 11, 2005 7:24 pm

Wait the 1.2.8 version. Will have a nice mode to catch multiple keys and make cheat codes! (will be released soon)
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby jj2197 » Fri Feb 11, 2005 9:34 pm

This dosen't solve my problem, Because I already bought It an I can't get anymore version updates.
User avatar
jj2197
 
Posts: 51
Joined: Sun Feb 06, 2005 10:01 am
Location: St. george
Score: 0 Give a positive score

Postby willg101 » Fri Feb 11, 2005 10:04 pm

hahahaha
I have the exact same prob!
http://www.wish-games.com
Old betas now available!!
User avatar
willg101
 
Posts: 473
Joined: Thu Dec 16, 2004 12:08 am
Location: West Michigan
Score: 5 Give a positive score

Postby jj2197 » Sat Feb 12, 2005 3:41 am

So is there a way to do it, without the version update. So I don't need to buy it again.
User avatar
jj2197
 
Posts: 51
Joined: Sun Feb 06, 2005 10:01 am
Location: St. george
Score: 0 Give a positive score

Postby makslane » Sun Feb 13, 2005 3:36 pm

Try this:

- Add a Key Down event (any key, repeat disable)
- Put the Script:

Code: Select all
storeLastKey(getLastKey());

if(areLastKeys("cheat")) //Catch the cheat word
{
   
    x += 10;
}


And now, put this code in Global Code editor:

Code: Select all
#define MAXKEYS 20
int lastKeys[MAXKEYS];

void storeLastKey(int key)
{
   int i;
   for(i = MAXKEYS-2; i >= 0; i--)
   {
      lastKeys[i+1] = lastKeys[i];
   }

 
   lastKeys[0] = key;
 
}

int areLastKeys(char *s)
{
    int n = strlen(s), i;
    if(n >= MAXKEYS) n = MAXKEYS - 1;
    n--;
 
    for(i = 0; i <= n; i++)
    {
        if(s[i] != lastKeys[n - i])
        {
            return 0;
        }
    }
 
    return 1;
}
Last edited by makslane on Mon Feb 14, 2005 1:28 am, edited 1 time in total.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby jj2197 » Sun Feb 13, 2005 5:51 pm

I couldn't get it to work.
I could only get it to work on a new
actor with just keydown (any key).
User avatar
jj2197
 
Posts: 51
Joined: Sun Feb 06, 2005 10:01 am
Location: St. george
Score: 0 Give a positive score

Postby makslane » Mon Feb 14, 2005 1:28 am

This must work in Key Down event of any actor.
What's happen?
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby jj2197 » Mon Feb 14, 2005 1:53 am

That's what I did.
It didn't work.
User avatar
jj2197
 
Posts: 51
Joined: Sun Feb 06, 2005 10:01 am
Location: St. george
Score: 0 Give a positive score

Postby brutalDeluxe » Mon Feb 14, 2005 2:30 am

:roll:
User avatar
brutalDeluxe
 
Posts: 43
Joined: Sun Dec 12, 2004 7:43 am
Score: 0 Give a positive score

Postby makslane » Tue Feb 15, 2005 2:36 pm

Load the working sample here:
http://game-editor.com/examples/cheat.ged
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby willg101 » Wed Feb 16, 2005 10:02 pm

Thank-you soooo much!!!
This is so useful!
http://www.wish-games.com
Old betas now available!!
User avatar
willg101
 
Posts: 473
Joined: Thu Dec 16, 2004 12:08 am
Location: West Michigan
Score: 5 Give a positive score

Postby jj2197 » Thu Feb 17, 2005 3:55 am

Now how do I make more then one cheat.
User avatar
jj2197
 
Posts: 51
Joined: Sun Feb 06, 2005 10:01 am
Location: St. george
Score: 0 Give a positive score

Postby makslane » Thu Feb 17, 2005 2:04 pm

Just change the "cheat" string in the if(areLastKeys("cheat")) code
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Next

Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest