3 Replies - 414 Views - Last Post: 01 October 2012 - 06:28 PM Rate Topic: -----

#1 Leveecius  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 01-October 12

Question on mixing codes

Posted 01 October 2012 - 05:05 AM

Hey guys, sorry if this is a new question but I didn't know where else to learn. I've had an idea for this for about 5 years now for an online text based rpg, but I can never seem to get it quite finished up. I'm good with HTML scripting as I've designed websites before and even had an online text based rpg going, however, I did have one major area of my game I couldn't finish because I didn't know what code to use. I've asked a bunch of different people over the years but still haven't gotten a solid reply, so maybe you guys can help.

I'm trying to figure out which scripting would be best to create an online market for my game for buying/selling between players, and buying/selling between the server (where the server prices randomly change given a range set on items every 2 or 3 hours or so). I know how to set the price ranges, but I can't seem to figure out what script would be best for the timers, as well as having the market open to deals between players in the game. Any ideas guys? Sorry again if this is a n00b question, but again, I didn't know where else to go.

Is This A Good Question/Topic? 0
  • +

Replies To: Question on mixing codes

#2 Leveecius  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 01-October 12

Re: Question on mixing codes

Posted 01 October 2012 - 05:15 AM

Sorry, I should probably add in there that I do in fact have PHP coding experience as well.
Was This Post Helpful? 0
  • +
  • -

#3 aaron1178  Icon User is offline

  • Dovakiin, Dragonborn
  • member icon

Reputation: 169
  • View blog
  • Posts: 1,297
  • Joined: 22-October 08

Re: Question on mixing codes

Posted 01 October 2012 - 06:14 PM

Hello,

In this case I would use Ajax. Ajax uses Javascript to communicate with PHP Asynchronously. So no reloading of the page to buy and sell items. As for the server timers, you can go with either Javascript timers or CronJobs, assuming your server provides you with Cron Jobs.

I found an article to get you in the right direction for Javascript timers:

Javascript Timers

And Cron Jobs

Cron Basics

And an introduction to Ajax

Ajax Intro

There are more then many tutorials here on Dream.In.Code about PHP, Ajax and Javascript, so you're not alone :)

I hope this helps :)
Was This Post Helpful? 0
  • +
  • -

#4 Leveecius  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 01-October 12

Re: Question on mixing codes

Posted 01 October 2012 - 06:28 PM

This actually does help! I appreciate the answer. I'll look into Ajax, seems like it could be the answer I'm looking for.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1