MySQL+PHP+Flash+as3 How to save into a mySql data from a Flash AS3 2d RPG game in OFFLINE programming.? - mysql

It's my first time to ask online about my programming problem and I hope I can get feed backs as soon as possible. Me and my partner are working on a project of doing a 2D RPG game using FLASH CS5.5, AS3, PHP(Dreamweaver cs5.5) and Mysql(xampp). I would like to know if there's any way that wwe can create the game and connect it to mysql where we can save and retrieve data after a game is played and save it in the players status so that when the player plays again, he can have the last status of his game to continue. We want it to be an OFFLINE game and anywhere i search in the net, all of the tips are for online games. PLease help us. Thank you.

Assuming the game is mostly written in ActionScript 3
In order to save data on the an SQL server you need to pass the data from AS3 to PHP and insert it into the server.
To do this, you will need to become familiar with AS3's JSON library. There are numerous ways to do this, including the popular as3codelib, but the JSON library is built in and is much simpler than it first appears.
I would explain it all, but this tutorial will get you familiar with it.
P.S: Like others have said, you will want to test this locally so make sure you know how to perform basic SQL queries and run PHP scripts using XAMPP. If you do not, this should help

If you only want this to run locally (i.e. a user has their own set of data), why don't you just use a SharedObject?
This lets you save data to the users machine very easily and much more efficiently.

Related

Is there any library to connect to Dota2 game server?

I am looking for a way to create a program to get real-time game data from live Dota2 games. In the official Dota2 client there are several ways of doing it. You can connect to a game server through DotaTV, you can join your friend's game or you can join a lobby as a spectator or a broadcaster before the game starts.
I think, all these ways use the same protocol to connect to a game server and to retrieve game data. So could you, please, propose any library for doing this? If there is no such a library, could you please give me some advice about how to create it by myself.
There is no library, but there is a console command _record file_name which tells Dota2 client to write replay of the currently played or spectated game to file. Than you can parse this file using Dota2 replay parser (Skadistat Clarity for example). They already have example for realtime parsing.

Sending data between 2 flash apps

I would like to create android/ios app that has a feature like candy crash life sending.
Is it possible in as3 to create such thing?
Do I need to use a server side or it can be done with flash and as3?
Short and simple: YES, most definitely you'll need server.
Also, bear in mind that if you plan to sell goods in the game or similar - you will need to verify the data send from the flash on the server. It's pretty easy to decompile the swf, make changes to say have unlimited moves, compile again and play.
If you're planing that, I'll suggest to make more research on how to make a "secure" game, since flash in general is considered as unsafe...

Ventrilo hook read in Flash ActionScript 3

I would like to play a flash animation when someone talks in the VoIP program Ventrilo.
I have a simple animation setup within Adobe Flash and I would like to somehow trigger it when a specific person talks "keys-up" in Ventrilo.
I know the G15 keyboard can access Ventrilo remotely and display who is talking in real time so I think it should be possible to use this event to trigger a movie clip play command if I knew how to access it. I have looked for example code but can't find any.
I know this is probably a highly complex task but I'm sure there is a genius on Stackoverflow how knows how to do it or could at least set me on the right path.
Many thanks,
This is not going to be an easy task and is going to require writing a C/C++ ANE.
You can use Windows API hooking to intercept calls from Ventrilo.
http://www.gamedev.net/topic/387670-api-hooking/
http://www.codeproject.com/Articles/2082/API-hooking-revealed
You would need to write an ANE to use this inside your AIR app.
http://www.flexjunk.com/2011/11/30/developing-an-air-native-extension-for-osx-and-windows-in-c/

What are some good ways to Save/Load files in AS3?

I am writing a game in ActionScript3 using Flixel as a base. I have been unable to find a good method for saving and loading files from the player's local hard drive. I know Flixel has a way to save game data to...I think...cookies that the player doesn't really have access to, and I want to avoid this.
I first learned programming in Java, and one thing I've seen a lot of is scanning (Scanner) and printing (PrintWriter) lines of strings to/from text files. Something like this for AS3 would be my ideal, but if there are other methods I'm open.
Does AS3 have anything in its basic library that can do this task well? Are there libraries I can download and include that do this well/better?
If your game is going to run on a webpage your options are limited. Due to security concerns Flash is limited to reading and writing files specifically selected by the user.
Should you be using Air to make a standalone game, you will have regular access to the filesystem and can write files much like with Java.
If not, you will be pretty much stuck with Flash cookie equivalent, SharedObject.

Is there a working Cocoa MySQL Xcode project?

Or has this been abandoned? I can't seem to find a modern sample project. I haven't been able to make any the old code I find work. I just want to write a simple Mac app that accesses an external MySQL database that's also involved in a PHP website.
The old CocoaMySQL project has been abandoned, but the project has been resurrected as Sequel Pro.
It's open source and you can get the source code here.
If you want a straight library that allows you to access MySQL, you might try the commercial MacSQL framework.
You can also just use the MySQL C API directly, however be careful because if you want to use this in a commercial app the licensing fees are high.
You might find it easier to write some PHP code on the server to deliver the results to your client using JSON or some other lightweight data interchange format. PHP has direct support for JSON and there is a great Cocoa framework that makes it easy to parse and generate JSON code.
This method allows you to completely abstract the database connection from your client, so it is relatively trivial to change the database if necessary in future.
Thanks, Rob, I have actually seen the links to Sequel Pro but I was confused when I got there. Part of my problem is that I am really bad at adding things to an Xcode project. Once I have a project in hand with the correct libraries and whatever all linked up, I can make use of the various methods or functions.
That's why I was asking if someone had a super simple project using MySQL that would hopefully compile for me right out of the box. I can then add all my objects and coding.
Can't seem to find anyone out there willing to hold the hand of us project-challenged. The project settings dialog box and codes that go in various boxes therein are very confusing to me.