Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   PlayerWorlds Main Forum (https://forums.graalonline.com/forums/forumdisplay.php?f=15)
-   -   Gears Are Turning... (https://forums.graalonline.com/forums/showthread.php?t=80771)

TheStan 07-24-2008 12:19 AM

Gears Are Turning...
 
Guess What?
A new playerworld is coming to light! The elegant and complex age of steam is coming to a server near you...someday soon! A steampunk server is currently in the works, created by Stan himself. The server is planned out, and getting started. Idea's from Aeko, Draenin, and I, have been one by one making there way into the server.

And Just For The Record....
Within the game lies quite a few classes, each of them picking several professions and thus learn techniques from them over time. Maybe you could be a soldier able to sharpen his blade as he prepares potions for the battle? Or, one could be the craftor, building and improving on things with steam. Get your guns, swords, and dancing shoes ready, because you'll need them all when you visit this server!

The server of course is still being developed, and could use all the help it could get...

Of course, I myself have just been doing all scripting with very, very little to no graphical or level help at all. So, I more than likely won't have any graphics to prove what work I HAVE gotten done. All I can do is show you functioning code.

So of course, if you want to help with this project, contact Stan!

Stan could be found on Ardeo, or:
thekidstan (AIM) or
[email protected] (MSN).

Loriel 07-24-2008 12:19 AM

So? Where is the functioning code?

Edit: Also what is the deal with the centered text that is irritating as ****

TheStan 07-24-2008 12:39 AM

On the server. I'm not going to post all the code on the forums for anyone to grab at. I'd have to give you a temp rc and read rights, which I don't mind at all.

Btw, I like centered text for some reason.

DrakilorP2P 07-24-2008 12:45 AM

Quote:

Originally Posted by TheStan (Post 1407543)
On the server. I'm not going to post all the code on the forums for anyone to grab at. I'd have to give you a temp rc and read rights, which I don't mind at all.

Btw, I like centered text for some reason.

Then just post short snippets.

Loriel 07-24-2008 01:07 AM

Don't bother, if you are worried that people are going to steal your grandiose ideas and scripts, chances are they are worthless anyway.

TheStan 07-24-2008 01:21 AM

Quote:

Originally Posted by DrakilorP2P (Post 1407544)
Then just post short snippets.

That I will do.

Quote:

Originally Posted by Loriel (Post 1407553)
Don't bother, if you are worried that people are going to steal your grandiose ideas and scripts, chances are they are worthless anyway.

I wasn't trying to come off as arrogant, but I would rather not have everything I've worked toward stolen as used elsewhere. If you can understand that.

DrakilorP2P 07-24-2008 01:24 AM

Quote:

Originally Posted by TheStan (Post 1407558)
I wasn't trying to come off as arrogant, but I would rather not have everything I've worked toward stolen as used elsewhere. If you can understand that.

Anyone that think they can successfully make a popular server using that method is probably not a threat.
Also, you're still coming off as arrogant.

TheStan 07-24-2008 01:31 AM

Classes:

Here, I have two of the main functions of the Classes System. This system is interdependent with the Professions and Techniques Systems (which I haven't gotten around to starting today.)

setClass(object, class) sets the player's class if it hasn't been set already. This is pretty much the function which will be called when a player chooses his class through an interface in-game.

advanceClass(object) advances the player's class to the next possible tier from the prior class.

Also, there are quite a few echos there because I just finished the Class functions NOT TOO long ago, so those were there for debugging pretty much.

PHP Code:

public function setClass(object, class) {
  
temp.cdata null;
  
temp.cbasevars null;
  
temp.cbasevar null;
  
temp.cmods null;
  
temp.cwmods null;
  
temp.finaldata null;
  
  if (!(
object.type in {"player"}) || object.objecttype() != "TMudObject") {
    
error("Mud Object (#s) is not valid!"object.name);
    return;
  }
  if (class == 
null) {
    
error("No class given to set!");
    return;
  }
/*
  if (classIsSet(object)) {
    if (!(getClassTier(class) > object.class[2]) || ((getClassTier(class) - object.class[2]) != 1)) {
      error("The given class (#s) does not have a higher tier than the current class! Or is not the next tier!", class);
      return;
    }
  }*/
  //else {
    //echo("Class has not been set yet.");
  
if (!classIsSet(object)) {
    echo(
"Class is not set.");
    
cdata findNpc("DB_Classes").getClass(class);
    if (
cdata.size() > 0) {
      echo(
"Found class data.");
      
cbasevars = {"classid""classname""tier""description"};
      
//cmods = findNpc("DB_Classes").getClassVar(class, "statmods");
      // May or may not do weapon proficiencies here
      //cwmods = findNpc("DB_Classes").getClassVar(class, "weaponproficiencies");
      
echo("BASE VARS: " cbasevars);
      echo(
"MODS: " cmods);
      echo(
"Weapon Proficiencies: " cwmods);
      for (
cbasevarcbasevars) {
        echo(
"BASE VAR: " cbasevar);
        
finaldata.add(getClassVar(class, cbasevar));
      }
      echo(
"FINAL DATA: " finaldata);
      
object.class = finaldata;
    }
  } 
}
/*
public function unsetClass(object) {
}*/
public function advanceClass(objectnext) {
  
temp.currenttier null;
  
temp.nexttier null;
  
temp.choices null;
  
temp.choice null;
  
temp.cbasevars null;
  
temp.cbasevar null;
  
temp.finaldata null;
  
  if (!(
object.type in {"player"}) || object.objecttype() != "TMudObject") {
    
error("Mud Object (#s) is not valid!"object.name);
    return;
  }
  if (!
classIsSet(object)) {
    
error("Mud Object (#s)'s class has not yet been set!"object.name);
    return;
  }
  
currenttier getClassTier(object.class[0]);
  
nexttier currenttier 1;
  echo(
"CURRENT TIER: " currenttier);
  echo(
"NEXT TIER: " nexttier);
  if (
currenttier != && nexttier != && nexttier currenttier && (nexttier currenttier) == 1) {
    echo(
"Tier checks complete.");
    
choices getClassVar(object.class[0], "nextclasses");
    for (
choicechoices) {
      echo(
"NEXT CHOICE: " choice);
      if (
choice == next) {
        
cbasevars = {"classid""classname""tier""description"};
      
        for (
cbasevarcbasevars) {
          
finaldata.add(getClassVar(choicecbasevar));
        }
        echo(
"FINAL ADVANCE DATA: " finaldata);
        
object.class = finaldata;
        break;
      }
    }
  }


Some Class data storage.

PHP Code:

/*** Classes Database ***
Author: Stan
*** Function List ***
  LEGEND:
    + Public Function
    - Private Function
  
  SERVERSIDE:
    (-) onCreated()
    (+) getClass(cl)
    (+) getClassVar(cl, cvar)
    
  v1.0, 07/23/08, by Stan
  
  ToDo:
  * Map out the rest of the classes, (ugh!)
***/
function onCreated() {
  
/*
    Indices:
      0 Class Id
      1 Class Name
      2 Class Tier
      3 Description
      4 Next Classes
      5 Stat Mods
      6 Syngergy Bonus
      7 Allowed Professions
  */
  
this.class_rebel = {
    {
"classid""rebel"},
    {
"classname""Rebel"},
    {
"tier"1},
    {
"description""A rebel."},
    {
"nextclasses", {
      
"bandit",
      
"begger",
      
"blader"}},
    {
"statmods", {
      {
"health"0},
      {
"stamina"0}}},
    {
"syngergies", {
      {
"test"0}}},
    {
"allowedprofessions", {
      
""}}
  };
  
this.class_apprentice = {
    {
"classid""apprentice"},
    {
"classname""Apprentice"},
    {
"tier"1},
    {
"description""An apprentice."},
    {
"nextclasses", {
      
"crafter",
      
"mechanic"}},
    {
"statmods", {
      {
"health"0},
      {
"stamina"0}}},
    {
"synergies", {
      {
"test"0}}},
    {
"allowedprofessions", {
      
""}}
  };
  
this.class_believer = {
    {
"classid""believer"},
    {
"classname""Believer"},
    {
"tier"1},
    {
"description""A believer."},
    {
"nextclasses", {
      
"gypsy",
      
"nurse"}},
    {
"statmods", {
      {
"health"0},
      {
"stamina"0}}},
    {
"synergies", {
      {
"test"0}}},
    {
"allowedprofessions", {
      
""}}
  };
  
this.class_gypsy = {
    {
"classid""gypsy"},
    {
"classname""Gypsy"},
    {
"tier"1},
    {
"description""A gypsy."},
    {
"nextclasses", {
      
"test"}},
    {
"statmods", {
      {
"health"0},
      {
"stamina"0}}},
    {
"synergies", {
      {
"test"0}}},
    {
"allowedprofessions", {
      
""}}
  };
}
public function 
getClass(cl) {
  return 
this.(@ "class_" cl);
}
public function 
getClassVar(clcvar) {
  
temp.var = null;
  
  for (var: 
this.(@ "class_" cl)) {
    if (var[
0] == cvar) {
      return var[
1];
    }
  }


Here a short little function for item application (using items etc.), it's more so used to interpret two arrays.

The first array, "scripts" is a list of functions to call when the item is applied. The second array, "scriptsparams" is a multi-dimensional array of params with each index of the array a sub-array of params that is to be sent with the function of the matching index in the "scripts" array.

PHP Code:

public function applyItem(id) {
  
temp.item null;
  
temp.null;
  
temp.null;
  
temp.fparams null;
  
  
item findItemById(id);
  if (
item.type() != 2) {
    return;
  }
  if (
item.applyable) {
    if (
item.equippable) {
      
equipItem(item);
    }
    else {
      for (
0item.scripts.size(); i++) {
        
item.scripts[i];
        
fparams item.scriptsparams[i];
        
        if (
this.hasFunction(@ f)) {
          
this.(@ f)(fparams[0], fparams[1], fparams[2], fparams[3], fparams[4], fparams[5], fparams[6], fparams[7]); 
        }
      }
    }
  }


The next is pretty much basically data transfering, saving and loading for the player's mud object which contains most gameplay variables. These two functions are just the meat of the loading and saving of the player's game data. Or so you could say.

PHP Code:

public function loadObject() {
  
temp.file null;
  
temp.var = null;
  
temp.null;
  
temp.data null;
  
temp.item null;
  
// Create object to load ini file to.
  
file = new TStaticVar();
  
file.joinedclasses serverr.t.inifile;
  
file.load(getObjectPath());
  
// Checks if the loaded file has an object key
  
if ({"object""items"in file.keys) {
    
// Go through each var saved in the ini file's
    // object key.
    
for (var: file.object.getdynamicvarnames()) {
      
// Load the var to the object
      
this.(@ var) = file.object.(@ var);
    }
    
// Go through all file item vars
    
for (ifile.items.getdynamicvarnames()) {
      
// Create pointer to saved data
      
data file.items.(@ i);
      
// Create item object then create pointer to it
      
item createItem(i.substring(1), data[0], data[1]);
      
      if (
data[2] == true) { // Item was equipped
        
echo("was equipped.");
      }
    }
    return 
true;
  }
  return 
false;
}
public function 
saveObject() {
  
temp.file null;
  
temp.var = null;
  
temp.null;
  
temp.item null;
  
// Create object to load data to
  // to save to an ini file.
  
file = new TStaticVar();
  
file.joinedclasses serverr.t.inifile;
  
// Clear keys for object and items
  
file.clearkey("object");
  
file.clearkey("items");
  
// Go through all object vars
  
for (var: Mud.objectvars) {
    
// Checks if the var should not be saved
    // if so skips over.
    
if (var in Mud.nosavevars) {
      continue;
    }
    
// Load the var to the object to save
    
file.object.(@ var) = this.(@ var);
  }
  
// Go through all the items
  
for (0this.items.size(); i++) {
    
// Make pointer to item object
    
item this.items[i];
    
// Check for invalid item data
    
if (item.type() != || item.qty =< || item.id == || item.id == null) {
      continue;
    }
    
// Create file vars
    
file.items.(@ "i" item.id) = {item.archetypeitem.qtyitem.equipped};
  }
  
// Save data
  
file.save(getObjectPath(), 0);


Note: I replaced all "percent" signs with "#" signs.

Edit: Also,

Quote:

Originally Posted by DrakilorP2P (Post 1407562)
Anyone that think they can successfully make a popular server using that method is probably not a threat.
Also, you're still coming off as arrogant.

Not really trying to, I apologize for that.

Inverness 07-24-2008 01:33 AM

You're not supposed to assume that anyone wants to steal your stuff.

And if someone actually did steal your stuff its not like they would go classic with it anyways.

TheStan 07-24-2008 01:35 AM

Stupid character limit...

I would also like to share with you the class tier list...

PHP Code:

(Best viewed Maximized.)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/
Melee profressions    Crafting professions    Mage professions                   
---------------------------Teir 1------------------------------/
.    
Rebel                 Apprentice               Believer   

--------------------------Teir 2-------------------------------/
. (
1)Bandit            (1)Craftor                (1)Gypsy
. (1)Begger            (1)Mechanic               (1)Nurse
. (1)Blader                

--------------------------Teir 3-------------------------------/
. (
1&2)Thief         (1&2)Blacksmith           (1&2)Magician
. (2)Street Performer  (1)Surveyor               (1)Illusionist
. (3)Soldier           (2)Steam Mechanic         (2)Doctor

--------------------------Tier 4-------------------------------/

. (
1)Criminal          (1)Weapon Designer     (1&2)Jester 
. (1&2)Dancer          (1)Armor Designer        (1)Summoner
. (2)Noble             (2)Steam Designer        (3)Court Healer
. (3)Hero              (3)Machinist              
 
--------------------------Tier 5-------------------------------/

.   (
1)Psychopath      (1)AdvWeapon Designer  (1)Court Jester
.   (2)Acrobat         (2)AdvArmor Designer   (2)Caller
. (3&4)Lord            (3)Secret Keeper       (2&3)Prophet
.   (4)Legend          (4)Electrician    
--------------------------Tier 6-------------------------------/
. (
1)Murderor          (1&2)Cyborg              (1)Arch-mage
. (2)Distorionist      (1&2)Android             (2)God Caller
. (3)Ruler             (3)Classified            (3)Angel
. (4)Master            (4)Entity                 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/ 

If you don't understand the number ordering this is how it goes, The number in the parenthesis is the class in the prior row and column that can be advanced to the class the number is next to...if you can understand that. I have trouble explaining things without even confusing myself occasionally.

Quote:

Originally Posted by Inverness (Post 1407566)
You're not supposed to assume that anyone wants to steal your stuff.

And if someone actually did steal your stuff its not like they would go classic with it anyways.

Right, right, I got it already Inver.

DrakilorP2P 07-24-2008 02:25 AM

Quote:

Originally Posted by TheStan (Post 1407565)
Classes:

Here, I have two of the main functions of the Classes System. This system is interdependent with the Professions and Techniques Systems (which I haven't gotten around to starting today.)

-Snip, too long-

The quality of this thread just increased dramatically.

haro41 07-24-2008 03:20 PM

i think if a steampunk server is going to be designed, it should need alot of steam.
meaning sweet particle emitters. graphics are going to be the central focus of the server. so good luck with that my friend.

fyi i think the class name Murderor is spelt wrong

Switch 07-24-2008 03:31 PM

I like those classnames :o
hopefully you can pull them off.

xXziroXx 07-24-2008 03:51 PM

A Street Performer turning into a Noble? Holy ****!

TheStan 07-24-2008 05:48 PM

Quote:

Originally Posted by xXziroXx (Post 1407718)
A Street Performer turning into a Noble? Holy ****!

Of course the schedule line ups etc, do need a bit of work. :p

Quote:

Originally Posted by haro41 (Post 1407709)
i think if a steampunk server is going to be designed, it should need alot of steam.
meaning sweet particle emitters. graphics are going to be the central focus of the server. so good luck with that my friend.

fyi i think the class name Murderor is spelt wrong

Definitely about the graphics. Also, in a bit of a hurry to get some test data up so you know how that can go.

Quote:

Originally Posted by Switch (Post 1407712)
I like those classnames :o
hopefully you can pull them off.

I'm trying.


Edit:

I just find this so cool...
http://hackedgadgets.com/2007/07/30/steam-punk-watch/


All times are GMT +2. The time now is 10:26 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.