• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

[Community Input] tfs 1.2 raid system rework

  • Thread starter Thread starter Evil Puncker
  • Start date Start date

What's your opinion?

  • Create a new raid system Lua based and remove the old raids.xml system

    Votes: 6 100.0%
  • Rework the old raids.xml system and still stick with XML

    Votes: 0 0.0%

  • Total voters
    6
  • Poll closed .
E

Evil Puncker

Guest
FIRST OF ALL: THIS IS PLANNED TO BE ON TFS 1.2+ ONLY (or whatever version @Mark chose to apply, if it ever gets accepted lol)
SECOND: yeah I know that we can do amazing things with lua and global events, but my intention here is to provide a good raid system BY DEFAULT instead of the old raids.xml system.

So my idea is to remove the entire source code related to raids.xml and work on something in Lua that will come in tfs by default instead... but if you really like the raids.xml system, lets at least rework it to give it more options and make it more user friendly.

Yeah raids.xml do the job but is so confusing and so limited (take a look at the code) that I wanted to ask for the community how would a raid system looks like for you? Please give some examples of config, remember that it should have things like:

  • name
  • chance
  • interval
  • margin
  • announce
  • single spawn
  • multiple spawn from x to z (maybe ignoring unreachable areas :D)
  • ability to spawn/remove NPCs
  • ability to run anytime or by a defined period
  • ability to be enabled by talkactions by default

all ideas and inputs are welcome! when we reach a mutual agreement I should move it to tfs issues so tfs developers can say the final word!

ps: vote in the poll
 
Last edited by a moderator:
Lua based ofc, hate the XML based system...
Ill throw you a PM of a thing I started working on, it is lua based with arrays that you then loop.

Edit: for some reason you have blocked PMs, so start one with me.
 
Last edited:
I've started working on this quite a while ago aswell.
a completly lua based system in an oop way.
ex:
Code:
local hell = Raid()

local wave1 = hell:newWave()
wave1:initialWave() -- will set wave1 as the first wave to be executed.
wave1:time = 0 (in seconds)-- how much time till this wave will start.
wave1:novaPos = Position(x,y,z) -- position of the center of the area to spawn the raid.
wave1:radius.x = 50; wave1:radius.y = 50; wave1:radius.z = 0
wave1:spawnMonster("Demon", 10) -- will spawn 10 demons at random tiles in the area.
wave1:spawnMonster("WHATEVER", 5)
wave1:clearMonsters() -- will despawn all monsters once the next wave starts.
wave1:callback(onWave1) -- it'll execute this function once the wave starts.

local wave2 = hell:newWave()
wave2:nextWave() -- will set wave2 the next index of the next available wave index (we use this for execution order)
wave2:time = 100 (in seconds)-- since this is not the initial wave it'll wait the time ammount of the last wave and add this onto it until it's executed.
wave2:novaPos = Position(x,y,z) -- position of the center of the area to spawn the raid.
wave2:radius.x = 50; wave2:radius.y = 50; wave2:radius.z = 0
wave2:spawnMonster("Skeleton", 10) -- will spawn 10 skeletons at random tiles in the area.
wave2:spawnMonster("Rotworm", 50)
wave2:callback(onWave2) -- it'll execute this function once the wave starts.

hell:execute() -- will start the raid
hell:stop() -- will stop the raid immediatly and despawn all monsters if there are any.

function onWave1()
-- we could handle broadcasts or such in here.
end

function onWave2()
--
end

here an example of how we can access raids and get some info of it.
Code:
hell:getMonsters() -- will return an array with all active raid monsters
hell:getMonsters()[1]:getHealth() -- would return the health of the first registered monster of the array in the raid list.

This system is pretty easy to handle and requires basicly no knowledge in creating raids, however I havn't fully done it yet and it still needs a lot of testing.
 
I've started working on this quite a while ago aswell.
a completly lua based system in an oop way.
ex:
Code:
local hell = Raid()

local wave1 = hell:newWave()
wave1:initialWave() -- will set wave1 as the first wave to be executed.
wave1:time = 0 (in seconds)-- how much time till this wave will start.
wave1:novaPos = Position(x,y,z) -- position of the center of the area to spawn the raid.
wave1:radius.x = 50; wave1:radius.y = 50; wave1:radius.z = 0
wave1:spawnMonster("Demon", 10) -- will spawn 10 demons at random tiles in the area.
wave1:spawnMonster("WHATEVER", 5)
wave1:clearMonsters() -- will despawn all monsters once the next wave starts.
wave1:callback(onWave1) -- it'll execute this function once the wave starts.

local wave2 = hell:newWave()
wave2:nextWave() -- will set wave2 the next index of the next available wave index (we use this for execution order)
wave2:time = 100 (in seconds)-- since this is not the initial wave it'll wait the time ammount of the last wave and add this onto it until it's executed.
wave2:novaPos = Position(x,y,z) -- position of the center of the area to spawn the raid.
wave2:radius.x = 50; wave2:radius.y = 50; wave2:radius.z = 0
wave2:spawnMonster("Skeleton", 10) -- will spawn 10 skeletons at random tiles in the area.
wave2:spawnMonster("Rotworm", 50)
wave2:callback(onWave2) -- it'll execute this function once the wave starts.

hell:execute() -- will start the raid
hell:stop() -- will stop the raid immediatly and despawn all monsters if there are any.

function onWave1()
-- we could handle broadcasts or such in here.
end

function onWave2()
--
end

here an example of how we can access raids and get some info of it.
Code:
hell:getMonsters() -- will return an array with all active raid monsters
hell:getMonsters()[1]:getHealth() -- would return the health of the first registered monster of the array in the raid list.

This system is pretty easy to handle and requires basicly no knowledge in creating raids, however I havn't fully done it yet and it still needs a lot of testing.

This is how we should do it actually, the script I used was ment to not require any source changes(globalevent script).
But since it will be added to the main repo(hopefully) we should just do it this way.
 
some nice extra features:

-add extra loot to raid monsters (say u have a demon raid, and by adjusting the raid settings u would be able to add so that they can drop magic sword so u dont have to make a new monster to do that)
-add x extra exp to raid mobs
 
This is how we should do it actually, the script I used was ment to not require any source changes(globalevent script).
But since it will be added to the main repo(hopefully) we should just do it this way.
actually this entire thing can be achieved entirely through lua using metatables.
At current state we do not need to make a single source change therefore.
 
Back
Top