Author Topic: Leveling & EP script in developmnet for 2.6.0  (Read 6499 times)

0 Members and 1 Guest are viewing this topic.

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Leveling & EP script in developmnet for 2.6.0
« on: January 23, 2007, 07:09:45 am »
I wrote the basic EP & Levelling structure, the character structure and a heal algorithm already... it all works, 2.6.0 commands are {}'ed


Code: [Select]
const
//Teams
ALPHA = 1;
BRAVO = 2;
CHARLIE = 3;
DELTA = 4;
SPECTATOR = 5;
HP_PER_LEVEL = 200;
MAX_LVL = 10;
EP_PER_LEVEL = 100;
//Game Modes
DEATHMATCH = 0;
POINTMATCH = 1;
TEAMMATCH = 2;
CTF = 3;
RAMBO = 4;
INF = 5;
HTF = 6;

SERVER = 255;

type tplayer = record
                 name: string;
                 ep,level,maxhp: integer;
               end;

var soldier: array[1..32]  of tplayer;

function GetEP(Killer,Victim:string): integer;
var KID,VID,multiplier,lvldif,EP: integer;
begin
  KID:=NametoID(Killer);
  VID:=NametoID(Victim);
  lvldif:=soldier[VID].level-soldier[KID].level;
  multiplier:=100 + 10 * lvldif;
  If multiplier<40 then
    multiplier:=40;
  EP:=1000 + (soldier[VID].level * EP_PER_LEVEL * multiplier DIV 100);
  Result:=EP;
end;

function MaxEP(ID: integer): integer;
begin
  Result:=2200 + (soldier[ID].level * 2000) + (soldier[ID].level * soldier[ID].level * 200);
end;

{procedure Heal(ID,percent,absolute: intteger);
begin
  DoDamage(ID,(-1) * soldier.[ID].maxhp * percentage DIV 100 - absolute);
end;}
 
 

procedure GainLvl(ID: integer);
begin
  soldier[ID].level:=soldier[ID].level+1;
  Command('say ' + IDtoName(ID) + ' reached Level ' + inttostr(soldier[ID].level));
  soldier[ID].maxhp:=4000 + HP_PER_LEVEL * soldier[ID].level;
  //Heal(ID,100,0);
end;

procedure ActivateServer();
begin
end;

procedure AppOnIdle(Ticks: integer);
begin
end;

procedure OnCommand(ID: integer;Text: string);
begin
end;

function OnRequestGame(IP: string;State: integer):integer;
begin
Result := State;
end;

procedure OnJoinGame(IP, Nickname: string;Team: byte);
begin
end;

procedure OnJoinTeam(IP, Nickname: string;Team: byte);
var JID: integer;
begin
  JID:=IPtoID(IP);
  soldier[JID].level:=0;
  soldier[JID].ep:=0;
  soldier[JID].maxhp:=4000;
  soldier[JID].name:=Nickname;
end;

procedure OnLeaveGame(IP, Nickname: string;Team: byte);
begin
end;

procedure OnFlagGrab(ID: integer;TeamFlag: byte;GrabbedInBase: boolean);
begin
end;

procedure OnFlagReturn(ID: integer;TeamFlag: byte);
begin
end;

procedure OnFlagScore(ID: integer;TeamFlag: byte);
begin
end;

procedure OnPlayerKill(Killer,Victim,Weapon: string);
var EP,KID,VID: integer;
begin
  KID:=NametoID(Killer);
  VID:=NametoID(Victim);
  If KID=VID then
    begin
      If soldier[KID].ep > 1000 + soldier[KID].level * EP_PER_LEVEL then
        soldier[KID].ep:=soldier[KID].ep - (1000 + soldier[KID].level * EP_PER_LEVEL)
      else
        soldier[KID].ep:=0;
    end
  else
    begin
      EP:=GetEP(Killer,Victim);
      soldier[KID].ep:=soldier[KID].ep + EP;
      If soldier[KID].ep >= MaxEP(KID) then
        begin
          If soldier[KID].level >= MAX_LVL then
          else
            GainLvl(KID);
        end;
    end;             
end;

procedure OnPlayerRespawn(ID: integer);
begin
end;

procedure OnPlayerSpeak(Name,Text: string);
begin
end;

procedure OnAdminConnect(IP: string);
begin
end;

procedure OnAdminDisconnect(IP: string);
begin
end;

procedure OnAdminMessage(IP, Msg: string);
begin
end;
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline Raithah

  • Camper
  • ***
  • Posts: 424
  • Life™
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #1 on: January 24, 2007, 10:14:08 pm »
Phew. That looks ... amazing.

What does it do ?

The preferred outcome of war is peace. Ironic, huh ?
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam auctor lectus pulvinar neque. Vestibulum commodo nisl convallis nisi. Aliquam in magna. Quisque orci. Duis sed nunc eu quam egestas feugiat. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla auctor turpis non urna. Sed porttitor. Donec et dui non odio.

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #2 on: January 26, 2007, 07:01:02 am »
it will be a script that allows your soldier to level throughout a usual soldat CTF match. with each kill, the script calculates an Experience (EP) value. Once you reached a certain amount of experience, you will level up and gain things like 5% more health, life generation, life leech (vampirism), extra weapons, powerfull spells and the like. scripting spells in soldat seems kind of hard though, you can't do anything classic, like a fireball, but you can make summon spells for example that summon like a couple of boogie men that guard your base for let's say 10 seconds.
it'll be a new and unique expirience imo.
i also tried scripting "evolvable" weapons, but that requires to load different weapon.inis, and everytime you change the ini to load a weapon for a guy that reached a new level, everyone and not only that one person will get the gun. that's a so far unsolvable problem and improvable weapons will therefore not be implemented
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline Krillious

  • Camper
  • ***
  • Posts: 324
  • If you were a hindu I could aim for the dot
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #3 on: January 26, 2007, 07:07:39 am »
can you script how much health someone has?? that seems pretty kickass

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #4 on: January 26, 2007, 07:25:21 am »
but you can make summon spells for example that summon like a couple of boogie men that guard your base for let's say 10 seconds.
Really? Even I didn't know that :S

Explain?

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #5 on: January 26, 2007, 08:56:39 am »
hm quite simple, a script that adds some bots via /addbot if someone says for example "/summon". it also sets a boolean type variable true which will trigger a countdown in AppOnIdle which will kick the bots after some time again. quite simple ;(

regarding the health stuff, enesce said it'd be quite possible that a negative value used in the new DoDamage() function will heal. so basicly what i'm going to do is to do a certain negative amount of damage (calculated in relation to the soldiers current level) on spawn of a player.
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline M.rSnow

  • Camper
  • ***
  • Posts: 482
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #6 on: January 26, 2007, 07:37:10 pm »
Man how can u read my thougths i wrote a tread on a request on this script at the same time u posted this tread. (two shouls same thougth...)
Anyway u got it all. Great script. Youst wondering is there anyway of using scripts in normal soldat game mode. like a non delicated server..
And 3 little questions
Are u goin to add teleport some how?
hope not i hate that..
-------------------------------
Are u going to have chooseable skills and characers?
Hope that it whould extend the felling.
-------------------------------
(Crazy suggestion) Are u going to get the same exp for all killz or are u going to get examper 1 m79 kill on 10m 1exp, 1 knife kill on 100m 50exp or something?
« Last Edit: January 26, 2007, 07:39:51 pm by M.rSnow »
Lapis: You need a vacation or a bullet though the head both works just fine by me.

Offline Leo

  • Soldat Beta Team
  • Veteran
  • ******
  • Posts: 1011
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #7 on: January 27, 2007, 01:55:44 am »
Someone who joins in the middle of a map, at a server running this script, will have no change. Did you think about it ? ;)

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #8 on: January 27, 2007, 07:05:00 am »
Someone who joins in the middle of a map, at a server running this script, will have no change. Did you think about it ? ;)

Code: [Select]
procedure OnJoinTeam(IP, Nickname: string;Team: byte);
var JID: integer;
begin
  JID:=IPtoID(IP);
  soldier[JID].level:=0;
  soldier[JID].ep:=0;
  soldier[JID].maxhp:=4000;
  soldier[JID].name:=Nickname;
end;

ya well he will start start at lvl 0, and he'll suck for the duration of that round... i could implement some algorithm that makes him start with the lowest level among the other players, starting at that level with 0 Ep. that'd fix it a bit :)
thanks for reminding me of that.

@Mr.Snow:
1.Teleport isn't possible yet with any script functions as far as i know.

-----

2. hm, no, you will however be able to choose which skill you learn with levelup, like you learn healing at lvl 3. but there are 3 kinds of healing:

- regeneration (small amount but simultaneous)
- carrion feed (gain life on kill, big amount)
- healing spell (heals 100% on command ("/heal"), has some cooldown, like 1 minute)

the script would then ask you which skill to learn and you'd choose with "/1", "/2" or "/3".

-----

3. you'll get no bonus for "skillfull" kills, but you will get a bonus for killingsprees. you get X % bonus where X is the square of the number of kills in a row
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline Toumaz

  • Veteran
  • *****
  • Posts: 1906
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #9 on: January 27, 2007, 07:18:03 am »
ya well he will start start at lvl 0, and he'll suck for the duration of that round... i could implement some algorithm that makes him start with the lowest level among the other players, starting at that level with 0 Ep. that'd fix it a bit :)
thanks for reminding me of that.

You know what would be a lot more awesome? If the player's progress was saved in a text file or something.

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #10 on: January 27, 2007, 07:25:57 am »
nope, that'd be too RPGish and is not appropriate for soldats fast gameplay. also, it'd cause a huge unbalance, since people that invest much time will easily pwn newcomers.

EDIT:

Fixed the Join Algorithm:

Code: [Select]
procedure OnJoinTeam(IP, Nickname: string;Team: byte);
var i,JID,temp: integer;
begin
  temp:=0;
  JID:=IPtoID(IP);
  soldier[JID].level:=1;
  If NumPlayers > 1 then   
    begin
      for i:=1 to 32 do
        If soldier[i].level > temp then
          temp:=soldier[i].level;
      soldier[JID].level:=temp;
    end; 
  soldier[JID].ep:=0;
  soldier[JID].maxhp:=4000;
  soldier[JID].name:=Nickname;
end;

the script is way complexer already than the one posted in my opening post
« Last Edit: January 27, 2007, 07:27:37 am by Avarax »
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline M.rSnow

  • Camper
  • ***
  • Posts: 482
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #11 on: January 27, 2007, 08:18:35 am »
Wait wait now.. U men that the skills ain't saved until next time u join?
Like every time you disconnect u get lvl0?
That isn't so funny...
It ain't hard to kill people whit sniper for example even if they have vampirism. (higher levels cant be harder than haxers whit tele hax huh?)
Can u at least Make it possible for exp save. Why don't just use the normal old Cs way.
U must type "/savexp" to save em.
Sorry for pushing you if this is hard (i dunno). But my opinion is that it be loads more funny..
You can of course have a max lvl save, like u have lvl 7 and then wen you return you have lvl 5 again. The return level can be anyway set lower and i think IF you can do this you can easily set return level to max that means u have the same level as b4 you left. Quite stretchable script then. But that's only IF you add it. *hoping*plz plz plz do*hoping*


Btw. Is it only me and Tomaz who thinks that it whould be awsome? I think most soldat players whould.
« Last Edit: January 27, 2007, 08:31:35 am by M.rSnow »
Lapis: You need a vacation or a bullet though the head both works just fine by me.

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #12 on: January 27, 2007, 08:35:57 am »
uh... No :D

EDIT:
Hooray, first spell functionally implemented: Summon Ghouls, variable levels of Skill possible
« Last Edit: January 27, 2007, 11:13:26 am by Avarax »
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline Mr. Domino

  • Flagrunner
  • ****
  • Posts: 969
  • Don't just sit there and waste your precious time.
    • XBLIG.co
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #13 on: January 27, 2007, 01:20:33 pm »
you can't do anything classic, like a fireball, but you can make summon spells for example that summon like a couple of boogie men that guard your base for let's say 10 seconds.
it'll be a new and unique expirience imo.
i also tried scripting "evolvable" weapons, but that requires to load different weapon.inis, and everytime you change the ini to load a weapon for a guy that reached a new level, everyone and not only that one person will get the gun. that's a so far unsolvable problem and improvable weapons will therefore not be implemented

Why not lock away the secondary weapons and mod them to use for spells. Obviously I don't know if it's possible, but I'd imagine it'd be possible to script the flame thrower along with, say, a chainsaw modded for flight, a LAW which causes a string of cluster-like ground explosions, a knife that homes in on a target (and/or acts like a bomb killing everything on screen), etc.

Anyway, sounds like a great idea overall, though I think Soldat may be a bit too fast to really appreciate the additions. Players will really have to bind the unique commands as taunts to get the most out of it.

Offline ghg

  • Camper
  • ***
  • Posts: 411
  • Village Idiot
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #14 on: January 27, 2007, 01:55:43 pm »
Sort of like a Soldat RPG?  ;D
-=Gradius wuz you=-

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #15 on: January 27, 2007, 04:59:04 pm »
hm no i will not mod the secondaries since i'm trying to keep it just like the usual soldat... anything that changes gameplay too much won't be implemented.

@ghg:
kinda, but it's only about the levelling, the rest is usual CTF (or others) soldat
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline M.rSnow

  • Camper
  • ***
  • Posts: 482
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #16 on: January 28, 2007, 07:28:08 am »
*cry´s quiet* no level save..
I would have loved it so..
Anyway i wonder how the level limits are set is it like 100 exp lvl and then up 100exp eatch level or is it like 100-300-600?
Lapis: You need a vacation or a bullet though the head both works just fine by me.

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #17 on: January 28, 2007, 02:14:29 pm »
EP needed to reach next Level = 3050 + ((CurrentLevel-1) * EPNEEDED_PER_LEVEL) + ((CurrentLevel-1)² * 100)


This here is a constant, i chose this value for now.
EPNEEDED_PER_LEVEL = 1800

Here are the EP values you'd need with this calculation:
Level 2: 3050
Level 3: 4950
Level 4: 7050
Level 5: 9350
... and so on
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline j4n0

  • Major(1)
  • Posts: 35
  • lolwut
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #18 on: January 28, 2007, 03:29:31 pm »
I want to see this on zombie servers. ;DDD !

Offline M.rSnow

  • Camper
  • ***
  • Posts: 482
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #19 on: January 29, 2007, 04:49:56 pm »
Thank you for the level list. I wonder how much Ep is gained for each kill
And is Ep gained only by killing or is it points so if you in point mush kill whit flag you get more Ep tan without?
Lapis: You need a vacation or a bullet though the head both works just fine by me.

Offline Clawbug

  • Veteran
  • *****
  • Posts: 1393
  • 1184!
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #20 on: February 03, 2007, 07:02:39 am »
Hmm, sounds and looks interesting. I wish there was a way to set a respawntime for every invidual player. You could shorten your respawn time as a skill, or ability. Could come handy in CTF, I think.
Fight! Win! Prevail!

Offline Will

  • Flagrunner
  • ****
  • Posts: 910
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #21 on: February 03, 2007, 08:11:22 am »
I think this would be cool for a singleplayer game. Could you like , deny the usage of an X weapon till you're X level. This would be really useful for spells and such.

SINGALPLEYAR HUZZAH!!!!!

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #22 on: February 03, 2007, 08:40:16 am »
I think this would be cool for a singleplayer game. Could you like , deny the usage of an X weapon till you're X level. This would be really useful for spells and such.

yes thats possible, with the finished script, you get the minigun as the ultimate gun if your reach the maximum level (maximum level can be customly defined). the minigun is disabled till then and then enabled at max level for that individual player as some ultimate gun.

@Clawbug:
yeah i thought of such skill, using the /setteam command to let the person immediatly respawn after death. but this terribly spawn the console with "X has joined alpha team" messages ;)

So far, i thought of making 3 spell classes, that improve and are learned every X levels. once you reach the required level, you are asked which of the spells of this class you want to learn:

Healing Spells - improves every 2 Levels - Choose between these spells:
-Instant Heal (on command, 1 minute cooldown): Heals you for 100%. With higher levels, you will heal even more than 100% of your max health and the cooldown decreases.
-Regeneration: Heals you for a small amount of health with every second. Heals faster if you are at very low health. Amount healed increases with higher level.
-Vampirism: Heals a big amount of health on kill and gives you some extra Expirience. Amount healed increases with higher level.

Summon Spells - improves every 5 levels - Choose between these spells:
-Summon Ghouls (on command, 3 minutes cooldown): Summons a couple of Ghouls with chainsaw on your team to protect your base for few seconds. Number of Ghouls, duration increases with higher level. Cooldown decreases with higher level.
-Summon Flame Spirit (on command, 5 minutes cooldown): Summons a mighty modded flamethrower wielding Flame Spirit on charlie team with LOTS of health that attacks everyone in the game. Duration increases with higher level, cooldown decreases.

Weapon Spells - improves every 3 levels - Choose one of these spells:
-Instant Reload (on command, 1 minute cooldown): instantly reloads your magazine with some extra ammo. Amount of Extra ammo increases with higher level, cooldown decreases
-Disarm (on command, 1,5 minutes cooldown): Disarms the nearest enemy for a couple of seconds. Duration increases with level, cooldown decreases.
-Carrion Ammo: Has a certain % chance to instantly reload your magazine on kill. % chance increases with higher level.
« Last Edit: February 03, 2007, 10:36:55 am by Avarax »
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline Krillious

  • Camper
  • ***
  • Posts: 324
  • If you were a hindu I could aim for the dot
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #23 on: February 03, 2007, 08:47:00 am »
how does it 'ask' you? a server message? and do you just type the answer?
and will the minigun be like your hovergun? :p

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #24 on: February 03, 2007, 10:29:10 am »
yeah it will ask you via a private server message. then you have to choose by writing /1, /2 or /3 in the console

you can mod the minigun however you wish, the script is quite customizable... i modded it as a flak gun firing cluster fragments... not too overpowered, yet very nice to keep opponents at range
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline mxyzptlk

  • Veteran
  • *****
  • Posts: 1493
  • The Panda Ninja
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #25 on: February 03, 2007, 01:21:17 pm »
Nice.

ONLY for 2.6.0?
*whine*

"While preceding your entrance with a grenade is a good tactic in
Quake, it can lead to problems if attempted at work." -- C Hacking

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #26 on: February 05, 2007, 12:29:39 pm »
lookey, i'm making some graphics for the manual of the script :D


---Warmth---

Category: Healing, Static

Heals you for 2% HP each second
If you are under one third of you maximum health, Warmth will regenerate 5% HP each second instead.
« Last Edit: February 06, 2007, 08:36:03 am by Avarax »
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline M.rSnow

  • Camper
  • ***
  • Posts: 482
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #27 on: February 05, 2007, 03:34:41 pm »
Nice addon to the script :)
(still want savexp)
Lapis: You need a vacation or a bullet though the head both works just fine by me.

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #28 on: February 05, 2007, 06:14:27 pm »
---Conjure Clip---

Category: Offensive, Spell ('/ofs')
Cooldown: 90 seconds

Instantly renews your ammo and even gives you some extra bullets.
The number of extra bullets is  X % of the default ammo of your gun, where X is (20 + 5 * skilllevel).
Cooldown decreases by 10 seconds per skilllevel.
« Last Edit: February 06, 2007, 08:59:51 am by Avarax »
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline Apocalypse

  • Major
  • *
  • Posts: 59
  • Who is the wiseman? beggar or king?
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #29 on: February 05, 2007, 06:44:06 pm »
cool  :o

could there maybe be a /sniper cmd where a sniper with like %99 accuracy guards where you sit or like /kruger and then 2 krugers follow you around?
Skin against skin blood and bone
You're all by yourself but you're not alone
You wanted in now you're here
Driven by hate consumed by fear


Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #30 on: February 06, 2007, 08:58:49 am »
---Disarm---

Category: Defensive, Spell ('/def')
Cooldown: 120 seconds

Disarms your nearest opponent for X seconds, where X is (2 + (skilllevel / 2)).
Cooldown decreases by 10 seconds per skilllevel.
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline xmRipper

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 742
    • Personal
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #31 on: February 06, 2007, 12:36:48 pm »
woow :o nice work
Co-Founder / CTO @ Macellan
Founder Turkish Soldat Community

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #32 on: February 06, 2007, 02:44:33 pm »
Well here is a definate list of spells and talents that will be in the script. you can learn and improve only one spell / talent out of each category:

Category: Healing
Warmth: static, regeneration
Holy Medikit: spell, 100% heal
Vampirism: static, life leech

Category: Defense
Disarm: spell, disarms nearest enemy for a short duration
Evasion: static, gives you a chance to avoid damage
Thorns: static, redirects an amount of damage to the damage dealer

Category: Offense
Conjure Clip: spell, reloads your magazine and gives some extra ammo
Carrion Ammo: static, gives you a chance to instantly reload with each kill
Critical Strike: static, gives you a chance to do double or even triple of the normal damage

Category: Summoning
Summon Ghoul: spell, summons some chainsaw bots on your team for some time
Summon Flame Spirit: spell, summons a mighty flame bot on charlie team for some time
Summon Spellshield: spell, summons a shield to block the next spell casted, also negates some static effects that would affect you in a negative way


the script is about 500 lines long already, including 3 out of the 12 spells and the levelling and spell-learning system
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline Frenchie

  • Camper
  • ***
  • Posts: 358
  • SoldatHQ
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #33 on: February 06, 2007, 02:55:05 pm »
Sounds like a nice script and I like those graphics for the manual.

But how do you determine the closest player, just wondering how you figure that out with GetPlayerXY()
Soldat Lobby Avec Players -New Release! - Updated AGAIN!


Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #34 on: February 06, 2007, 03:25:04 pm »


Pythagoras says:
c²=a²+b²

Avarax says:
Code: [Select]
        GetPlayerXY(caster,X1,Y1);
        temp:=999999;
        nearest:=0;
        for i:=1 to 32 do
        If i<>caster then
          begin
            GetPlayerXY(i,X2,Y2);
            If (X2<>0) and (Y2<>0) {and GetPlayerStat(i,'Alive')} then
              begin
                temp2:=sqrt((X1-X2)*(X1-X2)+(Y1-Y2)*(Y1-Y2));
                If temp2 < temp then
                  begin
                    temp:=temp2;
                    nearest:=i;
                  end;
              end;
          end;

This part:
   temp2:=sqrt((X1-X2)*(X1-X2)+(Y1-Y2)*(Y1-Y2));
is equal to what Pythagoras says and calculates the range from Soldier A to Soldier B. The rest is for finding out which is the nearest.
« Last Edit: February 06, 2007, 03:27:32 pm by Avarax »
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline Frenchie

  • Camper
  • ***
  • Posts: 358
  • SoldatHQ
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #35 on: February 06, 2007, 04:18:15 pm »
Wow thats a good way of doing it. ;D
Code snippet saved.

Can't wait till its out.
Soldat Lobby Avec Players -New Release! - Updated AGAIN!


Offline M.rSnow

  • Camper
  • ***
  • Posts: 482
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #36 on: February 08, 2007, 04:46:54 pm »
Question!
You typed:
---Conjure Clip---

Category: Offensive, Spell ('/ofs')
Is "/ofs" the command in game?
Lapis: You need a vacation or a bullet though the head both works just fine by me.

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #37 on: February 08, 2007, 06:11:05 pm »
yap

/ofs = shortcut for all offensive spells

here is another thread in General Discussion btw, if you havent noticed yet:
http://forums.soldat.pl/index.php?topic=10754.0
i introduced the EP system there and answered some other questions there
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline ghg

  • Camper
  • ***
  • Posts: 411
  • Village Idiot
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #38 on: February 09, 2007, 08:24:44 am »
Looking very promising so far. I look forward to playing this.
-=Gradius wuz you=-

Offline coolhunt

  • Major(1)
  • Posts: 25
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #39 on: August 01, 2007, 02:51:41 pm »
sorry i have a stupid question but i am new here

where i have to include the script

soldat/scripts and then?

socketcore.pas
core.pas
includes.txt
networkcore
or admincore?
www.dieteam.de.vu

soldat : 192.168.5.27 : 23073

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #40 on: August 01, 2007, 03:11:12 pm »
lock please.
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline coolhunt

  • Major(1)
  • Posts: 25
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #41 on: August 01, 2007, 10:11:11 pm »
what is false?

folder:
soldat/scripts

levels.pas :
Code: [Select]
const
//Teams
ALPHA = 1;
BRAVO = 2;
CHARLIE = 3;
DELTA = 4;
SPECTATOR = 5;
HP_PER_LEVEL = 200;
MAX_LVL = 10;
EP_PER_LEVEL = 100;
//Game Modes
DEATHMATCH = 0;
POINTMATCH = 1;
TEAMMATCH = 2;
CTF = 3;
RAMBO = 4;
INF = 5;
HTF = 6;
//Weapons
  DEAGLES = 1;
  HKMP5 = 2;
  AK74 = 3;
  STEYR = 4;
  SPAS = 5;
  RUGER = 6;
  M79 = 7;
  BARRET = 8;
  MINIMI = 9;
  MINIGUN = 10;
  FLAMER = 11;
  BOW = 12;
  FLAMEBOW = 13;
  SOCOM = 0;
  KNIFE = 14;
  CHAINSAW = 15;
  LAW = 16;

SERVER =255 ;

type tplayer = record
                 name: string;
                 ep,level,maxhp: integer;
               end;

var soldier: array[1..32]  of tplayer;

function GetEP(Killer,Victim:string): integer;
var KID,VID,multiplier,lvldif,EP: integer;
begin
  KID:=NametoID(Killer);
  VID:=NametoID(Victim);
  lvldif:=soldier[VID].level-soldier[KID].level;
  multiplier:=100 + 10 * lvldif;
  If multiplier<40 then
    multiplier:=40;
  EP:=1000 + (soldier[VID].level * EP_PER_LEVEL * multiplier DIV 100);
  Result:=EP;
end;

function MaxEP(ID: integer): integer;
begin
  Result:=2200 + (soldier[ID].level * 2000) + (soldier[ID].level * soldier[ID].level * 200);
end;

{procedure Heal(ID,percent,absolute: intteger);
begin
  DoDamage(ID,(-1) * soldier.[ID].maxhp * percentage DIV 100 - absolute);
end;}
 
 

procedure GainLvl(ID: integer);
begin
  soldier[ID].level:=soldier[ID].level+1;
  Command('say ' + IDtoName(ID) + ' reached Level ' + inttostr(soldier[ID].level));
  soldier[ID].maxhp:=4000 + HP_PER_LEVEL * soldier[ID].level;
  //Heal(ID,100,0);
end;

procedure ActivateServer();
begin
end;

procedure AppOnIdle(Ticks: integer);
begin
end;

procedure OnCommand(ID: integer;Text: string);
begin
end;

function OnRequestGame(IP: string;State: integer):integer;
begin
Result := State;
end;

procedure OnJoinGame(IP, Nickname: string;Team: byte);
begin
end;

procedure OnJoinTeam(IP, Nickname: string;Team: byte);
var i,JID,temp: integer;
begin
  temp:=0;
  JID:=IPtoID(IP);
  soldier[JID].level:=1;
  If NumPlayers > 1 then   
    begin
      for i:=1 to 32 do
        If soldier[i].level > temp then
          temp:=soldier[i].level;
      soldier[JID].level:=temp;
    end;
  soldier[JID].ep:=1;
  soldier[JID].maxhp:=4000;
  soldier[JID].name:=nickname;
end;

procedure OnLeaveGame(IP, Nickname: string;Team: byte);
begin
end;

procedure OnFlagGrab(ID: integer;TeamFlag: byte;GrabbedInBase: boolean);
begin
end;

procedure OnFlagReturn(ID: integer;TeamFlag: byte);
begin
end;

procedure OnFlagScore(ID: integer;TeamFlag: byte);
begin
end;

procedure OnPlayerKill(Killer,Victim,Weapon: string);
var EP,KID,VID: integer;
begin
  KID:=NametoID(Killer);
  VID:=NametoID(Victim);
  If KID=VID then
    begin
      If soldier[KID].ep > 1000 + soldier[KID].level * EP_PER_LEVEL then
        soldier[KID].ep:=soldier[KID].ep - (1000 + soldier[KID].level * EP_PER_LEVEL)
      else
        soldier[KID].ep:=0;
    end
  else
    begin
      EP:=GetEP(Killer,Victim);
      soldier[KID].ep:=soldier[KID].ep + EP;
      If soldier[KID].ep >= MaxEP(KID) then
        begin
          If soldier[KID].level >= MAX_LVL then
          else
            GainLvl(KID);
        end;
    end;             
end;

procedure OnPlayerRespawn(ID: integer);
begin
end;

procedure OnPlayerSpeak(Name,Text: string);
begin
end;

procedure OnAdminConnect(IP: string);
begin
end;

procedure OnAdminDisconnect(IP: string);
begin
end;

procedure OnAdminMessage(IP, Msg: string);
begin
end;


procedure OnException(ErrorMessage: string);
begin
//  WriteFile('ErrorLog.txt', ErrorMessage);
end;

function OnPlayerCommand(ID: Byte; Text: string): boolean;
begin
  //NOTE: This function will be called when [_ANY_] player types a / command.
  Result := false; //Return true if you want disable the command typed.
end;

procedure OnWeaponChange(ID, PrimaryNum, SecondaryNum: byte);
begin
end;

function OnPlayerDamage(Victim, Shooter: byte; Damage: integer): integer;
begin
  // Victim = Player Damaged // Shooter = Player doing the damage
  result := Damage;
end;

and yes i have done it into the includes.txt

need help
« Last Edit: August 02, 2007, 05:12:45 am by coolhunt »
www.dieteam.de.vu

soldat : 192.168.5.27 : 23073

Offline miketh2005

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 668
  • What's the URL for www.microsoft.com?
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #42 on: August 02, 2007, 11:11:25 am »
Do you have to change anything in this script, like i run a mod server and there is alot of kills, how would you lower the amount of EP you get for each kill?
Quote from: 'Ando.' pid='12999178' dateline='1309046898'
My new password is secure as shit :)
Mate, I am not sure Shit is even secured nowadays.

Offline coolhunt

  • Major(1)
  • Posts: 25
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #43 on: August 02, 2007, 01:55:08 pm »
something is wrong i didnt level up

Date Posted: August 02, 2007, 02:49:54 PM
or can anyone send it me
(email or icq or msn
msn : master-cool@hotmail.de
icq: 261721288
email : master-cool@hotmail.de
forum : dieteam.de.vu
www.dieteam.de.vu

soldat : 192.168.5.27 : 23073

Offline miketh2005

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 668
  • What's the URL for www.microsoft.com?
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #44 on: August 13, 2007, 03:11:14 pm »
anyone?
Quote from: 'Ando.' pid='12999178' dateline='1309046898'
My new password is secure as shit :)
Mate, I am not sure Shit is even secured nowadays.

Offline King_Of_Pain

  • Major
  • *
  • Posts: 73
  • Buy tickets to a Police concert. Now.
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #45 on: August 15, 2007, 05:39:27 pm »
This thread is very outdated, lock please.