饥荒联机版

饥荒联机版

评价数不足
factions
   
奖励
收藏
已收藏
取消收藏
文件大小
发表于
更新日期
41.613 KB
2016 年 8 月 1 日 上午 11:06
2021 年 6 月 8 日 上午 1:54
11 项改动说明 ( 查看 )

订阅以下载
factions

描述
fight in factions vs other factions!!
latest version : 2.0.2

this is a basic framework currently in beta stage.
This is a toolbox for people who know how to lua.
It does not magically divide players into factions it only allows you to do so!

!!You need pvp to be turned on for this to work!!

[standardfactions]:
-default faction for every player is neutral with pvp options turned off.
-red and blue faction both have icons

console command to change faction:

ThePlayer.components.faction:setFaction("factionname")
works for AllPlayers[#] too

for modders:

to add icons to your factions use spriter and create an anim file with the correct naming:
- Build = factionname_faction.scml
- bank = factionname_faction
- Animation = idle

you shouldn't need to change this mod at all.
The new custom icons can be placed into your own mod folder.
All you need to do is add these lines of code to your own modmain.lua

============================================================

local io = GLOBAL.io

-- only change this!
local icons =
{
"red_faction",
"blue_faction",
--"factionname_faction",
}

Assets = {}
for k,v in pairs(icons) do
if io.open(MODROOT.."anim/"..v..".zip") ~= nil then
Assets[k] = Asset("ANIM", "anim/"..v..".zip")
end
end

AddPrefabPostInit("world", function(inst)
for k,v in pairs(icons) do
inst.facicons[k] = v
end
end)

============================================================
v2.0.2
- hotfix: fixed clients crashing upon character select
v2.0.1
- hotfix

v2.0.0
features:
- removed admin faction
- pvp capability between factions is now a boolean flag, when 'false' members of a faction can neither attack nor be attacked by members of other factions.
- alliances: factions can now store a list of faction names as allies. By default all factions are hostile to each other if pvp flag is set for both parties. Alliances will disable pvp between the allied factions.

technical changes:
- reworked faction component
fields:
-- !just a template! --
self.table = {
name = nil
icon = nil
alliances = {}
members = {}
pvp = nil
}
self.parent = parent

functions:
faction:isAttackableBy(other)
faction:getAlliances()
faction:addAlliance(ally)
faction:removeAlliance(ally)
faction:getMembers()
faction:addMember(member)
faction:removeMember(member)
faction:getIcon()
faction:setIcon(icon)
faction:getPvP(pvp)
faction:setPvP(pvp)

- new 'world' component factions:
fields:
self.table = {
neutral = DEFAULT_FACTION,
...
}
functions:
factions:addFaction(name, icon, pvp)
factions:removeFaction(name)

==========================================================================

v1.0.9
- hotfix

v1.0.8
- "admin" faction cannot be pvped can pvp anyone if enabled in settings
- setting to enable or disable removing skeletons after 60 seconds

v1.0.7
- hotfix

v1.0.6
- removed ladder function as it makes no sense for this framework
will create a new mod for that
- improved implementation for your own custom icons.
- clean up of code structure

v.1.0.5
- added ladder framework

v.1.0.4
- even more bugfixes

v.1.0.3
- bugfixes

v1.0.2
- fixed bug where sometimes icons werent displayed

v1.0.1
- first public release














10 条留言
SirWorran 2022 年 8 月 20 日 下午 2:42 
Hi Andmann, I'm looking to set up a faction server for DST. I have interrest in your mod but i cn see it's not very polished yet, but I see lots of potential in this mod for the server I'd like to set up. If you are free, i'd love to chat with you! I see it's been more than 2 years already since u last worked on this, but maybe you'd like to chat about it.
andmann  [作者] 2020 年 8 月 9 日 上午 11:12 
alright here it is a new release! ^-^

I've made some fundamental core changes to the data structure.

to get started using this framework:

1) host a new game with this mod on
2) open console and type 'ThePlayer.components.faction:setFaction("red")'
3) you should see a red floating icon above your character
4) open console and type 'TheWorld.components.factions:addFaction("test", "blue_faction", true)'
5) open console and type 'ThePlayer.components.faction:setFaction("test")'
6) you should now see a floating blue icon above your character
7) disconnect from your server and reconnect to see whether your icon is still floating above your characters head
8) find a second player and put each other in opposing factions (red vs blue) and see if you can hit each other

This should confirm that your factions framework is setup properly in the background. You can of course test the other functions as well.
andmann  [作者] 2020 年 8 月 7 日 下午 4:15 
it should.
however If it doesn't I'm working on a new release which will come soon :)
ripper 2020 年 6 月 30 日 上午 12:52 
hi! does this still work?
tehswordninja 2017 年 9 月 29 日 下午 4:29 
been looking for a mod like this (i want to get a group of friends together and play some factions-styled ♥♥♥♥), i'll definitely look into using this soonish.
andmann  [作者] 2017 年 9 月 13 日 下午 7:16 
how so?
addicted2pawn 2017 年 2 月 21 日 上午 1:13 
couldnt get this to work unfortunately
andmann  [作者] 2016 年 11 月 17 日 下午 2:54 
@Cunning fox
a quickfix if you are adming you shoudl be able to use console commands, simply use:

"ThePlayer.components.faction:SetFaction("admin")" in console

I will add configuration for that feature though. I will pick up developement soon. Am a little stressed out with uni and studies atm.
CunningFox 2016 年 11 月 17 日 上午 4:37 
Can you please add configurations, so admin can attack oter players?
Moko Moko 2016 年 8 月 9 日 下午 6:49 
im gonna watch this i think it'd be great but i want to be for sure