PDA

View Full Version : v3 Arcade - Game Modification Guide


KW802
02-28-2009, 10:53 PM
How v3 Games Work

v3 Arcade games are a little different to those in the original Arcade and futureal's proArcade.

Instead of a simple getURL which sends all of the variables to the next page, the v3 Arcade uses a completely different system - a series of sendAndLoad events where data is sent and received between the Flash file and vBulletin. As a result, converting games for the v3 Arcade is a little more complicated.

To get games working with the v3 Arcade, a piece of code needs to be inserted which will run on every frame of the Flash movie. (I.e. one looped movieclip which is active across all frames.) A variable also needs to be set to tell the v3 Arcade code when to end the game.

Converting Games

Converting a game is quite simple, providing you have some basic knowledge of Flash.

Step 1.
Create a blank movie clip, containing two keyframes.

Step 2.
On frame 1 of this blank movieclip, insert this code (not forgetting to change the gamename value to something unique:

// HERE THE ARCADE SESSION IS INITIATED
// DON'T FORGET TO CHANGE THE GAMENAME VALUE!
if (this.sessionstarted != 1) {
this.arcade = new LoadVars();
this.sessionvars = new LoadVars();
this.arcade.gamename = "towerball";
this.arcade.sessdo = "sessionstart";
this.arcade.sendAndLoad("arcade.php", sessionvars, "POST");
this.sessionstarted = 1;
}

// IF GAMEOVER=1, SUBMIT THE SCORE AND REDIRECT THE PAGE
if (_root.v3gameover == 1) {
if ((this.askpermission != 1) && (this.sessionvars.connStatus == 1)) {
this.prequestvars = new LoadVars();
this.pranswer = new LoadVars();
this.prequestvars.gametime = this.sessionvars.gametime;
this.prequestvars.fakekey = this.sessionvars.initbar;
if (_root.v3score == 0) {
this.prequestvars.score = -1;
} else {
this.prequestvars.score = _root.v3score;
}
this.prequestvars.id = this.sessionvars.lastid;
this.prequestvars.sessdo = "permrequest";
this.prequestvars.note = (this.prequestvars.id*this.prequestvars.score*this.prequestvars.fakekey);
this.prequestvars.sendAndLoad("./arcade.php", this.pranswer, "POST");
this.askpermission = 1;
}
if ((this.pranswer.validate == 1) && (this.finalsent != 1)) {
this.burnscore = new LoadVars();
this.burnscore.microone = this.pranswer.microone;
this.burnscore.gametime = this.prequestvars.gametime;
this.burnscore.id = this.prequestvars.id;
if (_root.v3score == 0) {
this.burnscore.noscore = 1;
}
this.burnscore.sessdo = "burn";
this.burnscore.send("./arcade.php", "_self", "POST");
this.finalsent = 1;
}
}
Step 3.
Now, you need to let the game know when to finish the game and redirect the page. This is done by the setting of a new variable, "v3gameover". When _root.v3gameover==1, the game will end.

Before then, you need to find the "Score" variable for the game that you are editing. Now this often differs from game to game, but in general, _root.score is used.. Wrapping this in Number(int()), makes sure that the score value is passed through vBulletin correctly.

Find the frame of the "Game Over" page, and add this actionscript to the frame:
_root.v3score = Number(int(_root.score));
_root.v3gameover = 1;Save, and export the SWF movie to the appropriate place. :)

Oblivion Knight
05-12-2009, 03:52 PM
Updated.

John's instructions were fairly ancient, and can potentially cause conflicts with variables already set in the game.. This is basically what I use, and it works 99% of the time.

Our Sponsors
 

r1299
09-03-2009, 07:05 AM
How do you modify it? i need to use a program i think...
thanks

kris1911
09-12-2009, 04:11 AM
I also didn't know to modify.

Our Sponsors
 

imported_Tomale
09-11-2010, 09:39 PM
Actionscript 2.0 has been replaced by Actionscript 3.0. Can someone update the game modifications for AS3 games?