Author Topic: Simple ass RPG Level system  (Read 892 times)

//plevel.cs

if(%client.pexp == %client.pmexp)
{%client.level ++; %client.pexp = 0; %client.pmexp = 100 * %client.level;}




This is the Server.cs, and it loaded in game.

But it didnt work, which i wasnt surprised at.


That is in fact the entire code XD

Whats missing?

Code: [Select]
function obibitalRPGLevelUp(%client)
{
  if(%client.pexp == %client.pmexp)
  {%client.level++; %client.pexp = 0; %client.pmexp = 100 * %client.level;}
}

Code: [Select]
function somethingThatGiveloveP(%client)
{
  stuff
  obibitalRPGLevelUp(%client);
}


That should do it.

Code: [Select]
function obibitalRPGLevelUp(%client)
{
  if(%client.pexp == %client.pmexp)
  {%client.level++; %client.pexp = 0; %client.pmexp = 100 * %client.level;}
}

Code: [Select]
function somethingThatGiveloveP(%client)
{
  stuff
  obibitalRPGLevelUp(%client);
}


That should do it.

So what your saying is that When you do something that gets exp, it runs the function that checks for the exp requirement?


If so, what would the Stuff be replaced with?

So what your saying is that When you do something that gets exp, it runs the function that checks for the exp requirement?


If so, what would the Stuff be replaced with?
whatever crap happens when you do the thing

Code: [Select]
function obibitalRPGLevelUp(%client)
{
  if(%client.pexp == %client.pmexp)
  {%client.level++; %client.pexp = 0; %client.pmexp = 100 * %client.level;}
}

Code: [Select]
function somethingThatGiveloveP(EXP.KillRat)(%client)
{
  stuff (add Exp, chance of weapons ect?)
  obibitalRPGLevelUp(%client);
}



Thats what u mean? :3


basically

Thanks for assisting me on multiple occasions despite my lack of tourge knowledge

Now i just gotta find a way to have the script detect the death of a bot, but im sure if that will be complicated. :p

Thanks for assisting me on multiple occasions despite my lack of tourge knowledge

Now i just gotta find a way to have the script detect the death of a bot, but im sure if that will be complicated. :p
It's actually quite easy. This is the code from the bot events mod by amade.
Code: [Select]
function armor::onDisabled(%this, %obj)
{
parent::onDisabled(%this, %obj);
if(%obj.getClassName() $= "AIPlayer" && isObject(%brick = %obj.spawnBrick))
{
%obj.setImageTrigger(0, 0);
%obj.setImageTrigger(1, 0);
if(isObject(%obj.client))
{
%obj.client.delete();
}
$InputTarget_["Self"] = %brick;
$InputTarget_["Corpse"] = %obj;
$InputTarget_["Minigame"] = %obj.brickGroup.client.minigame;
%brick.processInputEvent("onBotDeath", %client);
if(isObject(%client = %obj.lastPusher) && (%obj.lastPushTime + 1000) > getSimTime())
{
%obj.setImageTrigger(0, 0);
%obj.setImageTrigger(1, 0);
%killer = %obj.lastPusher.player;
%minigame = %obj.minigame;
$InputTarget_["Self"] = %brick;
$InputTarget_["Killer"] = %killer;
$InputTarget_["Killer(Client)"] = %client;
$InputTarget_["Corpse"] = %obj;
$InputTarget_["Minigame"] = %minigame;
%brick.processInputEvent("onBotKilled", %client);
}
}
}

It's actually quite easy. This is the code from the bot events mod by amade.
Code: [Select]
function armor::onDisabled(%this, %obj)
{
parent::onDisabled(%this, %obj);
if(%obj.getClassName() $= "AIPlayer" && isObject(%brick = %obj.spawnBrick))
{
%obj.setImageTrigger(0, 0);
%obj.setImageTrigger(1, 0);
if(isObject(%obj.client))
{
%obj.client.delete();
}
$InputTarget_["Self"] = %brick;
$InputTarget_["Corpse"] = %obj;
$InputTarget_["Minigame"] = %obj.brickGroup.client.minigame;
%brick.processInputEvent("onBotDeath", %client);
if(isObject(%client = %obj.lastPusher) && (%obj.lastPushTime + 1000) > getSimTime())
{
%obj.setImageTrigger(0, 0);
%obj.setImageTrigger(1, 0);
%killer = %obj.lastPusher.player;
%minigame = %obj.minigame;
$InputTarget_["Self"] = %brick;
$InputTarget_["Killer"] = %killer;
$InputTarget_["Killer(Client)"] = %client;
$InputTarget_["Corpse"] = %obj;
$InputTarget_["Minigame"] = %minigame;
%brick.processInputEvent("onBotKilled", %client);
}
}
}


Thanks heed, too bad i cant read a word of that.... :[

Is there a tutorial that teaches you what the use of each symbole/phrase means? i would understand this alot more knowing that, and i dont think anyone wants to bother teaching me.

(Just sayin, i have searched for Tutorials on basics vut i could never find anything very usefull)


Lawl, its in this forum XD
« Last Edit: July 19, 2010, 05:54:09 PM by Obibital »

If you can't figure out which part of amade's code is required for the onBotDeath, you should learn to script before making an RPG mod.

If you can't figure out which part of amade's code is required for the onBotDeath, you should learn to script before making an RPG mod.

WTF DO YOU THINK IM DOING

Im trying to learn the script as a language NOT a code, as in SO I CAN READ IT IN ENGLISH, it would be a very helpful thing to know.

I cant figure it out because i cant read it.

PLUS im doing scripting for only specific parts of this RPG, most of it is/will be Events