Page 1 of 3

SA-MP like gamemode in BF1942 : Buying houses, cars, etc!

Posted: Tue Aug 24, 2010 12:50 am
by Endless
hi,
I'm Sp!tfire/Endless, 17 years old, living in Holland.
I used to mod Battlefield 1942 a few years ago..
Lately i've been thinking about BF1942 again, came up with an idea for a mod..
I know this is one of, if not the biggest BF1942 modding community alive, and I thought i'd share my ideas with you guys. so here you go. :)

Imagine.
A webserver running on my old dual core integrated graphics crap calculator from 2005.

/public_html/

Contains an index (index.php)
Contains a config file (config.php)
Contains a file to write to the con files (write.php)
Contains an user system (login.php, register.php, logout.php)
And many other weird files.
AND ObjectSpawnTemplates.con from my map.

huh?!??!????????????????????

People navigate to the website, create an account, and log in.
They start, for example, with 5000 cash, not ingame, just on the website.
The first thing they see on the website, is the minimap of our Battlefield 1942 map.
Imagine it has lots of roads, houses, nature, and, more. things.
All the houses are clickable.
As soon as they click on one of the houses, it will show the owner of the house, and the price. (This is just on the website, doesn't really have anything to do with our game yet. )
In this case, the house is owned by nobody, the price is $4000, we have $5000, so we will buy it.
As soon as you press the Buy button, your $4000 will be gone.
You will only have $1000 left, but.. you now own a house!
This is just simply done in PHP/MySQL. Nothing special.
On this website, you will also be able to purchase a car.
There are around 100 cars in the car lot, the cheapest car costs $1000.
We will buy the cheapest car, let's say it's a Nissan 200SX.
You now own a house, and a Nissan 200SX.
Every 24 hours, the server will do a daily repack.

WTF WAT?

Every night, I will shutdown my Battlefield 1942 server.
The language the website is written in, is called PHP.
PHP also allows you to write lines to text files.
As soon as someone purchases something on the website, like a car, a house, or a boat for example, the script will write your purchase into the MySQL database.
The MySQL database contains all the objectspawners from the map. Well, not really the spawners, just the names of the PCO it should spawn.
Everytime this happens, the script will rewrite the ObjectSpawnTemplates.con, with all the current assigned PCO's in the database.
Which means, when we bought our Nissan 200SX, the script already rewrote the ObjectSpawnTemplates!
The Spawner in front of 'our house' is called House1CarSpawner, and now has a Nissan 200SX assigned to it.
All what's left to do, is repack the map.
That's what happens every night.
I will shutdown the server, simply repack a new version of the map with the objectspawntemplates from our website, and voila.

This means, through a webserver, people will be able to purchase cool stuff online, with fake virtual money!
RuBBa_cHiKiN from the IS82 community has over 100 cars converted to Battlefield 1942.
They will all be buyable on the web based system.
People can buy houses, kits that will spawn in their houses ( with different clothes for example. )
Radio's/Music, boats, helicopters..
All done with serversidemodding, by just rewriting the objectspawntemplates.

BUT HOW CAN I GET CASHHHH????????????????????????//////////////////

Some of you might remember 'bfstats' or whatever it was called.
It was a ranked server system for Battlefield 1942.
It saves the round scores in readable files..
One round is 23 hours, after 23 hours, the web based system will read the round scores, and change those points into cash.(Be sure your ingame name is the same name as on the website! )

I was also talking to fo0k about this..
There should be some way to prevent players from stealing your car since they won't respawn.
Maybe a lock on the front door of your house.. a small tiny target that only you can see, if you shoot it, the front door will open for one minute ( First it go to a damaged mesh which is nothing, then slowly reheal itself )
In your house you will be able to enter a PCO which controls your garage door, spawns your car, etc.
This lock will require the user to repack the map too, which is kinda complex for the noobs if you ask me.. but there might be a better sollution.

I might have forgotten some things.. but this is basically what i've been thinking about lately..

EDIT:

About the locks, maybe have 4 meshes spawn infront of eachother, all four with different collision meshes.
On the website, you specify a 4 digit code for your house.
Ingame, all you have to do, is shoot the 4 numbers in the right order ( it will show as some kind of numpad texture on your door )
All 4 meshes will 'die', and voila. door is open.
I don't know if this works.. i'm too tired to think about this stuff right now heheh!
Cya tomorrow.

Re: hi im new i want to make mod help help !!!11111??

Posted: Tue Aug 24, 2010 2:37 pm
by fo0k
WELCOME, sir!

I think this would work.. and could be pretty fun.. even to use for unlocks for soldiers in a combat game.. lots of uses..

Need proof of concept I think.. can you get a very simple page running that will allow someone to buy something and then write the patch file...

There are some limitations on what can be done serverside although Im not the SSM pro at all... but this all sounds possible

If you could allocate things to people based on their keyhash somehow that would be epic. Perhaps remote manager can send an ingame message just to a specific user with key hash saying 'here is your unlock code today'.. thats probably asking too much..

Re: hi im new i want to make mod help help !!!11111??

Posted: Tue Aug 24, 2010 3:58 pm
by Endless
Don't know about the keyhash stuff.. never really thought about that.. don't think it'll work..

About the SSM limits.. all it does is change some spawners.. which is definately possible .. the cars/houses/boats/music all that stuff is already in the game..

Re: hi im new i want to make mod help help !!!11111??

Posted: Wed Aug 25, 2010 1:47 pm
by Dennis|8749236
engine problem coding problem.......
hmm...
many problem..

Re: SA-MP like gamemode in BF1942 : Buying houses, cars, etc

Posted: Tue Aug 31, 2010 8:41 pm
by Endless
what problem? :)

Re: SA-MP like gamemode in BF1942 : Buying houses, cars, etc

Posted: Tue Aug 31, 2010 11:02 pm
by fo0k
Good topic title change. Heheh

I think it's clear you know how to make it so make a test sir.. Make ze idea work with ye php/SQL/whateveryouuse skills.

You don't need help yet from what I can see. The idea looks solid. If you do need help to make a test just advise exactly what.

I wanna see this... Many posibilities :)

Re: SA-MP like gamemode in BF1942 : Buying houses, cars, etc

Posted: Wed Sep 01, 2010 6:02 am
by Rensa
Hmhm, i have experience with html,css,jquery,java script and also some php, but im not pro though.... in making login systems etc...

Re: SA-MP like gamemode in BF1942 : Buying houses, cars, etc

Posted: Wed Sep 01, 2010 8:48 am
by Swaffy
That would be ... an outrageously sweet mod. Similar to Empires, where you can build crap on the map. But better, I suppose.

Make this mod, and I will send you a "Thank You!" card with a nice smiley face on it.
... because that's the most I can offer at this moment, sadly.

Re: SA-MP like gamemode in BF1942 : Buying houses, cars, etc

Posted: Thu Sep 02, 2010 7:10 pm
by Endless
i'm not really a "mapper".
if someone could make a huge map, with lots of roads, houses (models + interior ), and some other shit the mod needs, then i'm willing to do all the coding + server hosting and stuff..

Re: SA-MP like gamemode in BF1942 : Buying houses, cars, etc

Posted: Thu Sep 02, 2010 7:25 pm
by fo0k
I'm up for making/helping with the map but surely makes more sense to test the concept first before making the pretty stuff? I guess just use existing bf tanks, vehicles and buildings for now on an existing map. (Berlin perhaps) ..Best to keep it on vanilla bf42 so anyone can help out without requiring a mod.