Paperclip
08-29-2005, 05:32 PM
Okay, so the title of this tutorial is protecting your game... well, how is that useful? Well, a war is raging right now between actionscripter and the decompilers. Is decompiling right? Well, on one hand you have a person who might have worked on a game for a really long time and the AS took so long and was perfect... then a guy who thought the game was cool, gets a decompiler and steals your AS for his own game. On the other hand you a chance to help the developement of games and AS knowledge spread. So, this tutorial is for the poor guys who don't want there AS knowledge to be leached out to the world.
There are four basic ways to blocking a person from getting into your game:
1. You can block them from inporting your game into flash by exporting your movie and selecting "protect from importing" without quotes. To do do this you need to come up with a password that you will remember but will be hard to crack from the outside hacker... I recommend using lower case and upper case letters along with numbers and weird symbols that would normal not be thought of as a password character like _-<>'";!@#$^&*()+= all of these can be used i think because flash doesn't care it is just checking for the correct characters when some one trys to import the swf. into flash...
So that is the easiest way to protect your game. The only bad thing about this is that it can be easily crack and figured out (same thing). So if you want to take more time and do another way then you have 2 locks for your map. Keep on reading...
2. The second way you can protect your game (note i'm used to making games in warcraft 3 so i call them maps as well, don't get confused) is by making a password to actually play the game itself. This doesn't really seem useful for a game because then you will have to keep changing the pasword if you want people to play it and not spread the password around, so this method is usually used for sending download links (that is what i'm using to send my game files to my scripters) to people or to send notes or something. Anyway, this method will actually make you do something in flash.
Step 1: Open up flash...
Step 2: Make a box and fill it in with any color...
Step 3: Insert a new layer and make a input text box that shows the backround and border.
Step 4: Name the variable of the input text box "inputName" without quotes...
Step 5: Insert a new layer above or below the text field and make a "enter password" button, again without quotes.
Step 6: Insert a new layer above everything and name that layer "actions" w/o quotes...
Step 7: Go to frame 10 and insert a key frame into all of the layers...
Step 8: Go to actions and put this code in:
password = inputName
if (password == "what ever your password is...") {
inputStatus = "Access granted!" ;
} else {
inputStatus = "Access denied!" ;
}
For once leave the quotes...
Step 9: Go to your first frame of "Actions" and insert this code in:
stop();
Step 10: Go to your first frame of your button, not in the edit frame but the first frame where you button is located and insert this code into it:
on (release) {
gotoAndStop(10);
}
Step 11: Go to the 10th frame of your button layer and insert this code into your button:
on (release) {
gotoAndStop(1);
}
Step 12: Your done... test your movie and see if your password works.
For you desired effect you can edit this part of the code to show whatever you want the person to see when you enter the correct code, as well as the incorrect code:
if (password == "what ever your password is...") {
inputStatus = "Access granted!" ;
} else {
inputStatus = "Access denied!" ;
}
__________________________________________________ ________
Download Example Password System:
Flash MX 2004: http://files.filehosting.org/oi35971.zip
Flash MX: http://files.filehosting.org/dh35974.zip
__________________________________________________ ________
3. The third way you you can protect your map against stealers or people who want your game for there own site is to make you game only playable on your website or browser.
Step 1: Open Flash
Step 2: Insert this code into your actions panel somewhere, perferably in the first frame:
myURL=_url;
okDomain="www.yourwebsite.com"
if (myURL.indexOf(okDomain) != -1) {
_root.gotoAndStop("game screen")
}else{
_root.gotoAndStop("warning message");
}
All this code does is runs a check at the beginning of the game (probably the most obvious place to put this is after the game loads) and sees if the game is running on your website, if it isn't then the game will simply not run. wOOt no game stealers without your permission. So, the bad thing about this as your only pertection is that decompilers, (back to that war now) can easily convert your swf. to a fla. and change that setting to allow it on there website or just delete the code intirily making them able to host it anyway and making you pissed. Of, course you can always contact there ISP and report the illegal activity of stealing your game you did not give permission to of hosting on there site and usually the ISP doesn't support illegal activity and will remove it. If not, call mommy and daddy for a lawyer, because you are going to court.
4. The last and probably the most impressive of all of the protective way to protect your game is an "Obfuscator" this is a program that makes your actionscript hard to desifer, actually it is impossible to read or understand. What a "Obfuscator" does is it makes all the possible character and parts of your AS turn to gibberish and still work. The best part about this is that the code itself will still operate normally but if a person trys to copy your action script into there own game there computer/flash won't know what it is and they will get about 200 errors. So, this is a solid safe way that no one can get past. To access a "Obfuscator" you can register at www.debreuil.com (http://www.debreuil.com/) message boards and then you can access he "Obfuscator" at www.debreuil.com/vs/ (http://www.debreuil.com/vs/) .
NOTE: for some weird reason the registration hasn't been working for me at all and comes up with an error every time say that the information couldn't get to the group data or something like that so i'm thinking that it is down, though i tried 3 weeks ago and it was still down so i'm not sure what is going on with that, but if you can get it to work then lucky you...
I hope this tutorial has helped you with your understanding of protecting as well as crafty and secret ways to send notes in class. hehe <_<. Hope you enjoy making your maps/games, more protective. If you want to test your protecting skills give me a call becauese i can tell you in a sec if it works or not, "Decompiler" baby...
There are four basic ways to blocking a person from getting into your game:
1. You can block them from inporting your game into flash by exporting your movie and selecting "protect from importing" without quotes. To do do this you need to come up with a password that you will remember but will be hard to crack from the outside hacker... I recommend using lower case and upper case letters along with numbers and weird symbols that would normal not be thought of as a password character like _-<>'";!@#$^&*()+= all of these can be used i think because flash doesn't care it is just checking for the correct characters when some one trys to import the swf. into flash...
So that is the easiest way to protect your game. The only bad thing about this is that it can be easily crack and figured out (same thing). So if you want to take more time and do another way then you have 2 locks for your map. Keep on reading...
2. The second way you can protect your game (note i'm used to making games in warcraft 3 so i call them maps as well, don't get confused) is by making a password to actually play the game itself. This doesn't really seem useful for a game because then you will have to keep changing the pasword if you want people to play it and not spread the password around, so this method is usually used for sending download links (that is what i'm using to send my game files to my scripters) to people or to send notes or something. Anyway, this method will actually make you do something in flash.
Step 1: Open up flash...
Step 2: Make a box and fill it in with any color...
Step 3: Insert a new layer and make a input text box that shows the backround and border.
Step 4: Name the variable of the input text box "inputName" without quotes...
Step 5: Insert a new layer above or below the text field and make a "enter password" button, again without quotes.
Step 6: Insert a new layer above everything and name that layer "actions" w/o quotes...
Step 7: Go to frame 10 and insert a key frame into all of the layers...
Step 8: Go to actions and put this code in:
password = inputName
if (password == "what ever your password is...") {
inputStatus = "Access granted!" ;
} else {
inputStatus = "Access denied!" ;
}
For once leave the quotes...
Step 9: Go to your first frame of "Actions" and insert this code in:
stop();
Step 10: Go to your first frame of your button, not in the edit frame but the first frame where you button is located and insert this code into it:
on (release) {
gotoAndStop(10);
}
Step 11: Go to the 10th frame of your button layer and insert this code into your button:
on (release) {
gotoAndStop(1);
}
Step 12: Your done... test your movie and see if your password works.
For you desired effect you can edit this part of the code to show whatever you want the person to see when you enter the correct code, as well as the incorrect code:
if (password == "what ever your password is...") {
inputStatus = "Access granted!" ;
} else {
inputStatus = "Access denied!" ;
}
__________________________________________________ ________
Download Example Password System:
Flash MX 2004: http://files.filehosting.org/oi35971.zip
Flash MX: http://files.filehosting.org/dh35974.zip
__________________________________________________ ________
3. The third way you you can protect your map against stealers or people who want your game for there own site is to make you game only playable on your website or browser.
Step 1: Open Flash
Step 2: Insert this code into your actions panel somewhere, perferably in the first frame:
myURL=_url;
okDomain="www.yourwebsite.com"
if (myURL.indexOf(okDomain) != -1) {
_root.gotoAndStop("game screen")
}else{
_root.gotoAndStop("warning message");
}
All this code does is runs a check at the beginning of the game (probably the most obvious place to put this is after the game loads) and sees if the game is running on your website, if it isn't then the game will simply not run. wOOt no game stealers without your permission. So, the bad thing about this as your only pertection is that decompilers, (back to that war now) can easily convert your swf. to a fla. and change that setting to allow it on there website or just delete the code intirily making them able to host it anyway and making you pissed. Of, course you can always contact there ISP and report the illegal activity of stealing your game you did not give permission to of hosting on there site and usually the ISP doesn't support illegal activity and will remove it. If not, call mommy and daddy for a lawyer, because you are going to court.
4. The last and probably the most impressive of all of the protective way to protect your game is an "Obfuscator" this is a program that makes your actionscript hard to desifer, actually it is impossible to read or understand. What a "Obfuscator" does is it makes all the possible character and parts of your AS turn to gibberish and still work. The best part about this is that the code itself will still operate normally but if a person trys to copy your action script into there own game there computer/flash won't know what it is and they will get about 200 errors. So, this is a solid safe way that no one can get past. To access a "Obfuscator" you can register at www.debreuil.com (http://www.debreuil.com/) message boards and then you can access he "Obfuscator" at www.debreuil.com/vs/ (http://www.debreuil.com/vs/) .
NOTE: for some weird reason the registration hasn't been working for me at all and comes up with an error every time say that the information couldn't get to the group data or something like that so i'm thinking that it is down, though i tried 3 weeks ago and it was still down so i'm not sure what is going on with that, but if you can get it to work then lucky you...
I hope this tutorial has helped you with your understanding of protecting as well as crafty and secret ways to send notes in class. hehe <_<. Hope you enjoy making your maps/games, more protective. If you want to test your protecting skills give me a call becauese i can tell you in a sec if it works or not, "Decompiler" baby...