#mod_development
1 messages ยท Page 101 of 1
player
I guess im far from being able to formulate that in PZ terms, but when i know more i may come back and ask
youre trying to make it server sided right? Maybe its updating the player position wrong and reseting the event location when you move and fixing it that way?
Ah ok. You were talking about zeds grouping or spawning from vamps IIRC.
The way I handle fly offs is it stops trying to go to its last target and instead repeats its last movement
maybe try to set a final point to move after flying over the player object?
I think it's related to the jet's speed
thats how i fixed the zombie spawn to last known player location... they sometimes wouldnt react to anything after getting there
yeah. Dont know the lore about it but it could be as a kind of protection or the effect of the stuff they use to make their "nests". They would rest in kind of like gooey cocoons. And the stuff would need some tiles and textures and all that. I think it would be amazing to venture into a high risk location with the vamps added
sometimes they would react normally
This sort of project will definitely get you into the weeds with PZ modding.
Sounds fun and even if you don't make it out to be entirely what your vision is for it right now, it'll teach you.
The best part about modding is jumping into the unknown.
trying to make AI that specific might require you to make all your zombies blind and actually apply your own AI entirely
Thats why i asked. Look i dont have a lot of experience but ive touched a bit of few things like pixelart, coding etc to be able to make videogames. So its not impossible for me.
in terms of nesting and avoiding light/daylight
Sorry i didnt know you were speaking to me, i thought you were talking about your mod
you mean remake that whole part of the code?
Well anyone judging you right now is a straight-up meanie. I'm saying to have fun and go wild.
the zombies wouldnt change
make zombies go to a random nearby building even i can do that
I feel like making zombies not step outdoors but still be aggressive indoors is pretty complicated lol
a bit, but not that hard
you could use isoPlayers... ๐ฎ
Or at least not that much. Vampires would have few new features but it would be like superstrong sprinter
i have a script somewhere that they react only if the player touches them when inside a building
a failed project ๐
Thx!
i ended up not having the time to do it neither or the patience
attract zombies to building by turning on / off the lights, lol
hmm the jets getting stuck only happens in MP
they would come out
See, that could be when in the nests in the day
yeah but its unrealiable code
Well, if it comes from Chuckleberry himself i take it as it comes
like @sour island said... you probably have to make your own AI logic and make the zombies blind
Totally doable, just alot of work
Well, anyway, you can picture more or less my idea too
yp u mean that yo u make th logic as if you would do it for a zombie and then just applaying it to the vamps?
that they can follow you?
more like you can have your own separate "entity" that you can manipulate without having to do the same for all the zombies
whats isoplayer?
keeping the zombies following the normal game AI
the object players use
and only having the vampires react to the sun
thats what i mean
i figure
You mean in PZ coding isoPlayer is the object itself
How its called
this would be worse?
As in to use the methods for running, jumping fences etc?
and giving it to the vamps to create the logic right?
oh right the modData thing
also figured out the issue with the events I think - gameSpeed being 0 in MP
yep
the threshold for hitting 'arrived' became super tiny
so the jet kept missing the player
Ok, i see its like a course. Ill read the whole wiki and then Ill be able to understand the terms you use better. Thank you guys. And thansk so much for the all the effort you put in mods. They make the game into something far beyond. See you later
Hmm Isoobject.sendObjectChange() looks promising, wish there was a lua event thrown in there
Took a break trying to sync zombies/player stuff
Zombies have an OnlineID but Not sure if there's a getZombieByID somewhere
kind of hackish but I guess I could send a command with x/y to target an isoObject on the same coord
๐ค
can verify OnlineID that way
is 'transmitCompleteItemToClients` a catch all?
guess not
how can i make a trait where someone starts with a bite? as simple as possible
im using profession framework so to my understanding i use OnGameStart = function(trait) and then put the code all below it
and i saw someone's post on how to get player damage and a body part
here getPlayer():getBodyDamage():getBodyPartโ(BodyPartType.Hand_R)
can i just make a short line of code that has no circumstances tied to it?
bitten on left forearm
What is the best way to add a piece of clothing to % of all the zombies when they spawn in without having to manually edit every zone
Is there a definitive way to identify an object (of type https://projectzomboid.com/modding/zombie/iso/IsoObject.html); i.e. I see there is a getType() method which returns an IsoObjectType but it only seems to have a few types declared in the ENUM (or, most objects are just isMoveAbleObject, which isn't precise enough to identify the specific item).
you can use instanceof(obj,"type") if you know the type and want to confirm
i.e. like all items have a "system name", such as a Alcohol Wipes is "Base.AlcoholWipes", which I trust to be the same no matter if the item is renamed or across translations etc.
usually you identify them by sprite in this situation
if you need the type from an IsoObject I use local type = tostring(isoObject):match('[^.]+$'):match("(.-)@")
afaik getClass() may not work outside of debugmode
I've checked using getName() and that does give me the name of the object in game (such as "Rain Collector Barrel") but it doesn't feel like it would be a stable interface.
or atleast getClass():simplename()
Does anyone know which table I need to insert into to forcibly add a peice of clothing to ALL zombie outfits?
there's outfit definitions and they don't inherit from eachother so you'd have to add to each one
what exactly are you trying to add?
I'm trying to rewrite Scaly Zeds (It changes zombies to use furry models), because it vanished from the workshop
Scaly Zeds used UnderwearDefinitions to forcibly add the appropriate costumes but that feels pretty hacky to me and I'm looking for a better way to do it
was there any issues with that approach?
Not sure, I could see it possibly having some issues (namely it replaces underwear)
I'll give that a try
Hey there, want to ask if there's a way to Activate a clothing accessory item without it being equipped in the primary/secondary hand? Like in the Better Flashlights mod where there's a mining helmet, am trying to do a tactical watch with a small light source, it works but will get equipped in the secondary hand instead of being a wearable
Anyone familiar with network stuff know how to avoid zombies going stale?
I got the attack code for events sending to all clients and when the zombie gets knocked down it gets set to stale and deleted
I followed the steps in the video but when trying to put the mods in the folder it does not appear in the game. Is there a folder for "RadioTest" to download it and replace the files inside?
If you're publishing, you need to follow the Mod Template structure, its in a different folder C:\Users\xxx\Zomboid\Workshop\
Oh man.. I'm staring into the void in terms of projects I could work on...
An analytical transpiler for Lua. :X
Gosh darnit.
Was working on a whole last of us mod with spores and clickers and whatnot. Other people in the project lost interest but man it was shaping up. Damn shame.
I worked on tiles and textures in the project. Hereโs an ingame hud element concept I worked on. Hoping at some point in the future I can work on it again if they ever want to pick it back up. I just thought itโd be cool to share.
Does server store getModData on its side or its a client thing only?
nevermind got into it already
Albion explained this before.
Zeds data dont persist and cannot be stored anywhere
IBrRus also told me its impossible to change zed animations too. It wont work like how you do it for human characters. Only works if you directly place it on the installation dir
And everyone else's who play on that server must do the same
I think this is for tiles only. Not sure if it applies to item
You can make mod Data persistent with zombies, if you set them as reanimated survivors, I would just caution people to not get too spammy with adding a lot of data to a lot of zombies and the like as it could affect zombie optimizations and other undesired effects if used to excess.
Zombie outfits are also persistent, you can also do many custom zombie outfits just using outfits to handle them.
Oh, I'm not an animation guy in the least, but I believe it's a case of all zombies use the same animation set? But I'm not an animation person.
Don't know anything about that stuff ๐คท
(@ HERE) Main page of complete modding guide done ๐
Please check and write what I forgot or maybe you will have suggestions/requests
Page: https://pzwiki.net/wiki/User:Aiteron
Pls help with allowing us to use autodesk maya for 3d related stuff
Please! A tool that imports exports and preset would mean alot
Anyone tried to construct IsoObject directly? Wondering if there is some API piece for creating world objects instead.
Also it seems like any pre-defined map object IsoCell x and y return either nil or 0
isocell is not a map object
isocell represents the loaded area, it has nothing to do with mapping 'cells'
Here what I found in other mods. For what you want to use IsoObject?
Oh I see.
Create world object based on existing sprite, either cosmetic or tech purpose not sure yet. I just need something to grab on.
constructor(arg0?: zombie.iso.IsoCell | zombie.iso.IsoGridSquare, arg1?: string | zombie.iso.IsoGridSquare, arg2?: string | zombie.iso.sprite.IsoSprite | boolean, arg3?: boolean);
Apparently I need the IsoGridSquare instead of IsoCell
or even both.
Interesting is how do you find both procedurally, not by "standing" in it.
If you search the vanilla code there are many examples of IsoObject usage as well ๐
Hey guys, I wanna get custom settings for Brita's for dedicated server.
I downloaded this template (https://steamcommunity.com/sharedfiles/filedetails/?id=2694082254), edited the settings.
How do I go about assigning new (and unique) workshop ID and publishing the mod?
Is there a proper way to get both cell and square by world x,y?
It absolutely must be within 150 tiles or something? of an actual instance of a player if you are trying to access unloaded cells/squares. Fully accessing unloaded/distant squares/cells, the way that people often want to do, isn't something the engine supports, and can even crash a game sometimes when you accidentally try to use data from them.
getSquare(x, y, z)
Server-side knows that too?
So in short what I will try to achieve is to have a specific array of coordinates where IsoObject should be constructed. Lets call it "stash". So this stash from client perspective can by anywhere on the map and I was guessing to manage that on server side all the time, however I'm not entirely sure where this is going in meaning of replication. Can I construct such object from server? Will it be replicated to clients?
In the sense of what you are trying to do, you can only manipulate squares when they are in the vicinity of a player. Full stop.
I, as a dev, working with the unfettered java, can't properly access and do stuff with a square, unless it is in the vicinity of a player.
Ensuring that a square is properly within the vicinity of a player with the stuff I do before trying to evaluate or manipulate it is a constant thing I have to pay attention to in my job.
You can somehow delay the stuff you are trying to do until a player is in the vicinity of the square, but I would caution you that the usual means for that, which I used myself when I was a modder, utilizes the OnLoadGridSquare event, which is not optimal as it can get expensive.
I have unlisted mods of mine that use OnGridSquare on account of how dissatisfied I am with the performance in a MP context.
Oh, so its like streaming to players. So basically my best option here is to attempt to construct it, check if its valid (can be streamed to any player at all) and be happy about it and simply sync coordinates from server to all clients each N-whatever.
There probably are other means to accomplish that, this is just off of the top of my two brain cells.
Pretty much, but check if the square is valid before trying anything in the first place ๐
Oh wait, you can check square validity? That would be even better, ty.
yeah, something like, as pseudocode as I am lazy and about to go to bed; this is not code to cut and paste, but just a flowchart?
function doSomeSquareShit (x, y, x)
local mySquare = getSquareOrSomeOtherFuckingFunction(x, y, z)
if not mySquare then return false -- if you don't have a square there's nothing to be done
do something with mySquare
end
something like that.
Yeah sure, night. 7AM here myself trying to read through TS defs to understand whats going on.
Thanks I got some idea now how cell and square exactly related .
You could also use the fact that the function returns false if there's no square as a tool to use in the whole stash spawning algorithim, if doSomeSquareShit (x, y, x) == false then try again later end
Yeah that's nice, because its probably not a good idea trying to construct a whole object in a square that is not streamed to anyone 
nice video ๐
It would have a fair chance of crashing a MP server, so it's extra important to have extra safety checks for that sort of stuff?
I like the idea of creating usable mods as an example. There should be a section on best practices or dos and don'ts
RIP that I got rick-rolled from the wiki. 
some people can remember the url dQw4w9WgXcQ
Okay, so this jumped into my head as a possible solution, although it wouldn't work in all cases (such as games where the world map is disabled)
- when a player triggers a stash event, their map is marked with the location, and the data regarding the location is saved somewhere, I would use globalModData
- when a player right clicks on a square, there is an world context menu event check thingy that compares the squares coordinates to the global mod data stash details table
- if it is a stash, then the stash is spawned and revealed to the player.
Not ideal in that it both depends on the world map, and doesn't pre-construct the stash tiles, requiring player interaction to spawn them in.
Another way that may work is that you could make your stashes use the vanilla annotated map system; I'm not overly familiar with it, but I believe it might be able to handle a lot of what you want to do, although I don't know how good it is for handling outdoors locations?
But I think exploring those two possibilities, and how the annotated map system works, might serve as a practical starting point if nothing else? ๐
Also, you can technically use the OnLoadGridSquare event to check every square that a player loads to see if it is a stash square, and if so, then construct the tiles there, it's just that it is expensive in my experience, and again, I found the effects it had negative in MP. But if you want a working prototype, or consider the effect to be a worthwhile price, it would work?
it's not bad if you index into a table by coordinate and do nothing if there's nothing, i do that for my vehicle respawn mod
insignificant overhead
if you do actual checks in the onloadgridsquare then it gets.. way worse
what would cause my RCON panel to be sending stuff twice? For e.g. if I send a servermsg then it appears twice ingame, or if I put "additem _____" (etc) it would do the command twice. Should I change my RCON port? >.<
actually probably I should ask in the pz support since its not really mod related huh. NVM
I'm not talking about modData - I'm applying changes to zombies in MP and the system is reading them as problematic and deleting them
Using simply local square = getSquare(x, y, x) will return a square if one is loaded. Adding a if not square then return end after will cut off the code.
You can also do something to forcibly load a square on an xyz but it's a bit finicky.
Ye
For EHE we use a spawning system that stores xyz and only creates the objects once a player gets close enough using loadSquare. However, depending on what you're trying to do this may be overkill.
If forcibly loading the square is possible (using get
orSetSquare) you might be able to apply modData.
I haven't tested what getorsetsquare does with squares outside of the technical cell - I'm hoping it corrects with saving
Hello!
I am trying to debug a simple error in my mod, precisely at adding traits and making them mutually exclusive;
local crybaby = TraitFactory.addTrait("Crybaby", getText("UI_trait_crybaby"), -5, getText("UI_trait_crybabydesc"), false, false);
local volatile = TraitFactory.addTrait("Volatile", getText("UI_trait_volatile"), -10, getText("UI_trait_volatiledesc"), false, false);
TraitFactory.setMutualExclusive("Crybaby", "Volatile");
TraitFactory.setMutualExclusive("Desensitized", "Crybaby");
TraitFactory.setMutualExclusive("Desensitized", "Volatile");
The error is:
Callframe at: setMutualExclusive
function: BreakIntoTearsTraits.lua -- file: BreakIntoTearsTraits.lua line # 5 | MOD: Break Into Tears
Caused by: java.lang.NullPointerException: Cannot read field "MutuallyExclusive" because the return value of "java.util.LinkedHashMap.get(Object)" is null
at zombie.characters.traits.TraitFactory.setMutualExclusive(TraitFactory.java:33)
... 24 more```
Line 5 is ``TraitFactory.setMutualExclusive("Desensitized", "Volatile");``
I had assumed it was a typo, but can't really fine any typos so I am not sure what's causing the error
Apparently same error happens at the line before it as well, TraitFactory.setMutualExclusive("Desensitized", "Crybaby");
Oh my god that's obviously much more efficient than the stupid check I was doing ty
I just realised that Desensitized is not a trait in typical sense that you can pick, but only comes with the Veteran job
Still though, as per game files, such traits are set mutually exclusive in the typical way with others, so I am not sure what's the issue
Are you using the vanilla code as a reference? I don't have it open but that might help you.
It's the same as what I've done
TraitFactory.setMutualExclusive("Desensitized", "Hemophobic");
is your function done OnGameBoot?
not quite, the first code block is literally what the whole file contains
Yup, that was the issue
I created a function and added it into OnGameBoot, error is gone now
Thanks โค๏ธ
@hollow current
That means that you need to require every mod file that overwrites that trait now 
um what
or just wait a few ticks before execute his code
I followed the way More Traits mod did it
yes that would be my solution too
require('NPCs/MainCreationMethods');
function(functionname)
code block
end
Events.OnGameBoot.Add(functionname);```
hmm okay
what's the function to wait? never used it before
more simple way to wait a few ticks is
require('NPCs/MainCreationMethods');
local function onGameBoot()
local ticks_to_wait = 3
local function onTick()
if ticks_to_wait > 0 then
ticks_to_wait = ticks_to_wait - 1
return
end
Events.OnTick.Remove(onTick)
--your code here
end
Events.OnTick.Add(onTick)
end
Events.OnGameBoot.Add(onGameBoot);
looking at dynamic traits mod, I would name my file ~zzzTraits.lua and then add it to the event or hook to the DoTraits function.
will only work well if other mods use same way
yeah I see that.
Is the OnTick running on MainMenu, maybe you need a different event
I think much other devs don't give a shit about more compatibility
OnFETick for main menu
btw I'm not sure if is OnTick don't call in main menu
never tried
btw at this point I'd just tell the other guy to fix his code
who to tell and what?
no idea, just saying... sometimes you don't need to care about every ๐ฉ
yeah, facts-facts
Ah its ok, i'll just spawn it once square is streamed, no need to preload it by any means
No idea
Maybe rcon is logged in as a player lol idk
a dumb question... adding traits to a char doesnt need to be done via server right? Can just do it locally
since it only affects the targeted player
or should i also make it server sided?
da fuq have i done

๐
hmm im having a weird problem
local sourceId = source:getOnlineID();
local ZedQ = tonumber(args.ZedQ);
local Zedx, Zedy, Zedz = SpawnLoc(source)
print("Zedspawn [".. sourceId .."] quant: ", ZedQ)
print("Zedspawn [".. sourceId .."] XY: ", Zedx,Zedy)
print("Zedspawn [".. sourceId .."] PlayerXY: ", source:getX(),source:getY())
createHordeFromTo(Zedx, Zedy, source:getX(), source:getY(), ZedQ)
end```
if i set the zedx and zedy to the player x and y
the zombies show
if run a randomizer or add value to the vars manualy
they just dont spawn
anyone knows what does this class do?
How to block player build anything on water (I mean river or lake) by using Lua code (Is there the another way ?) ?
Guide me please, thanks you.
But you cant build on water by default
Interesting....
I see player can build floor tile and box on water. So how to prevent them build it on water ?
Show the rand function
You should create an api that disables build . You wre also the one that adked abt the sand right? Same answer
It's me.
"
Your answer --> You have to hook to the vanilla build fuctions and add a check if the grounds tile is part of an array you make fontianung all the various sand floor tiles
"
But I don't know what it mean or how to. You mean edit build fuction that it is lua code, right ? and where is its folder ?
Thanks.
Yes look for it on contextmenu related lua. Not sure which one
Maybe worldobjectmenu is the name idk im afk i cant check for u
Thank you again, I will try this weekend.
๐ซก
I'm trying to create a client connects to server but controlled by AI, it's for adding the NPC to server. Is it possible and where should I start?
the function is working
just lowered the value to be closer to me
the zombies just stay there and dont go to the player
and now i was raging about the air events and i just remembered it has to be client side
chuck was saying something about not working when its server side
hm?
im triggering the getFreeheli something
from the server side
and i just get this
a sec gonna trigger it again
but i can triggered it client side right?
the servr side events don't update due to gametime being 0 serverside
it will upate the other players?
Yes, it can be activated client side - as in the debug commands
Yes, but... that's big stinky
It's already changed
just leave it as serverside on your end - Ill let you know once the update is out
LOG : General , 1675341843272> 141,843,102> -- Target: zombie.characters.IsoPlayer@622be81d: Donnell Hadden
LOG : General , 1675341843272> 141,843,102> - EHE: IsoPlayers adding:Donnell Hadden
LOG : General , 1675341843272> 141,843,103> -- EHE:XY: MIN_X:5258 MAX_X:6258 MIN_Y:10706 MAX_Y:11706
LOG : General , 1675341843273> 141,843,103> --- HELI 4 (jet) [gotoTarget] crashChance:0 crashing:false
LOG : General , 1675341843273> 141,843,103> - EHE: LAUNCH: HELI 4 (jet) [gotoTarget] day:2 hour:21
yeah just stays there for while
then unlaunches the heli
gonna put this on the client side then
ill change it back to server side when you update ๐
alrighty
but the createHordeFromTo(Zedx, Zedy, source:getX(), source:getY(), ZedQ) is making no sense
?
the zombies spawn but dont move to the xy
where do they spawn to? nothingness?
they do spawn
at the zedx zedy
but that function is supposed to make the zombies move to a point
in sp they do move to the point ( in my case the player xy when the event is triggered )
oh I didn't know that was a thing
on mp, they just stand there
oh this is your own thing
no no its a function in the game
is the location very far out?
so i changed the random values to be closer to the player
they spawn but dont move
then i thought maybe is because im in ghost mode?
but no... in sp even with me in ghost mode they move to the point i specify
since im setting a spawn point and a destination point, ghost mode has no influence in it
public void createHordeFromTo(int var1, int var2, int var3, int var4, int var5) {
n_spawnHorde(var1, var2, 0, 0, (float)var3, (float)var4, var5);
}
the java takes me here - but I can't find where n_spawnHorde is...
im gonna try something... maybe im using it wrong in mp... maybe in mp ghost mode stops them from moving ( makes no sense but nothing left to try )
ghost mode doesn't stop ai moving in SP?
not with that function since you set the point for them to move to
first arg is the spawn loc, second the move to loc
Challenge1.SpawnZombies = function(count)
-- init wave...
if getCore():isDedicated() then return end
first arg pairs
might be a reason they disabled the challenge in MP
well i guess i need to make another randomizer for the zombie spawn loc to make them spawn closer to the target player
i could use "nill" sound to make them move but... that will atract all the zombies not just the ones spawned
so... thats not a viable solution
the fact they spawn and don't get deleted is a good sign
you're spawning them in on server side or sending it back to all clients?
server side
this is new
the marker has the offset broken?!
let me try another event
for my far spawning system I have it called clientside - but you don't have the spawning causing you problems
I'd wager the server is trying to move them but something is relaying a different set of instructions
how close are you spawning them?
if they're out of the cell it might be falling back into unloaded stuff
i've tried 10 - 10
๐
they just stand there
but can do it again
a sec
yeah they spawn but dont move
but they do react to the heli from your mod
Honestly this network stuff is still giving me trouble
I'll have to actually check if my zombies are responding properly to server side events now
also still can't find n_spawnHorde
but I think the n_ is perhaps a way to call spawnHorde( ?
most likely
new animation for drunk walk ๐
i guess ill have to ... make my own function to move the zombies
....
but ... why does it work on sp and not sp...
makes no bloody sense
maybe its related to the same problems youre having with EHE? the gametime?
private static void onTriggeredZombieFile(String var0) {
DebugLog.General.println("ZombiePopulationManager.onTriggeredZombieFile(" + var0 + ">");
ZombieTriggerXmlFile var1;
try {
var1 = (ZombieTriggerXmlFile)PZXmlUtil.parse(ZombieTriggerXmlFile.class, var0);
} catch (PZXmlParserException var3) {
System.err.println("ZombiePopulationManager.onTriggeredZombieFile> Exception thrown. " + var3);
var3.printStackTrace();
return;
}
if (var1.spawnHorde > 0) {
processTriggerSpawnHorde(var1);
}
if (var1.setDebugLoggingEnabled && bDebugLoggingEnabled != var1.bDebugLoggingEnabled) {
bDebugLoggingEnabled = var1.bDebugLoggingEnabled;
DebugLog.General.println(" bDebugLoggingEnabled: " + bDebugLoggingEnabled);
}
}
private static void processTriggerSpawnHorde(ZombieTriggerXmlFile var0) {
DebugLog.General.println(" spawnHorde: " + var0.spawnHorde);
if (IsoPlayer.getInstance() != null) {
IsoPlayer var1 = IsoPlayer.getInstance();
instance.createHordeFromTo((int)var1.x, (int)var1.y, (int)var1.x, (int)var1.y, var0.spawnHorde);
}
}
the n stands for native - it's likely a call to the C++ portion of the library that handles zombie management (PopMan64.dll) (or whatever the 32 bit module is called, if you're on 32 bit)
we unfortunately don't have any way to know what's actually going on in those, because they aren't COM libraries and you can't easily decompile C/C++
seems like spawning hordes creates an XML?
hmmm
my best guess would be it's calling the other functions with the same names
also I don't actually see the part where they tell the zombies to move
private static void processTriggerSpawnHorde(ZombieTriggerXmlFile var0) {
DebugLog.General.println(" spawnHorde: " + var0.spawnHorde);
if (IsoPlayer.getInstance() != null) {
IsoPlayer var1 = IsoPlayer.getInstance();
instance.createHordeFromTo((int)var1.x, (int)var1.y, (int)var1.x, (int)var1.y, var0.spawnHorde);
}
}
well yeah, the module has C functions that are named that, but the native call just calls them from Java via interop
also the moving portion is likely within that library as well
no you're using the luamanger one
that calls on this all
@LuaMethod(
name = "createHordeFromTo",
global = true
)
public static void createHordeFromTo(float var0, float var1, float var2, float var3, int var4) {
ZombiePopulationManager.instance.createHordeFromTo((int)var0, (int)var1, (int)var2, (int)var3, var4);
}
I'm trying to read through the internals
but the (apparently) c++ stuff is going in circles
english today is not working for me
i meant thats what the function im using "calls"
yes
you more or less have to shoot blind here, and trust that the native is doing what you need it to. kinda have to rely on existing vanilla code to figure out where the native exit point should be
the problem is native doesn't use hordespawning in MP
if im not in ghost mode yeah
the issue is they don't get told to move?
they react to me
my best guess would be interference with what ever syncs the zombies
also if the zombies don't have an authOwner it may not know to even process anything in MP
could you relay the spawnHorde command back to clientside?
the popmanager will probably group them eventually, but it might take time. without a leader assigned, they probably won't roam at all, so it's possible that doesn't happen with manually spawned ones
call a serverCommand within the clientCommand to see if that fixes the moving
they react normaly to everything in the world
including the heli
or player
its like the instrunction to move to xy is not triggering
oh, you're trying to move them manually?
ah okay, I see
I'm surprised this function is even a thing - I was going to try to do a roaming horde mod next ๐
are you calling it on the server?
yup
LOG : General , 1675344004235> 144,004,065> Zedspawn [0] quant: 10
LOG : General , 1675344004235> 144,004,065> Zedspawn [0] XY: 5746.2392578125 11207.4462890625
LOG : General , 1675344004235> 144,004,065> Zedspawn [0] PlayerXY: 5758.2392578125 11207.4462890625
it's a bit hackish but if it works ๐คทโโ๏ธ
so youre telling me to send a command to the client triggered by the client sending a command to the server?
thats a frankenstein solution, but if it works... i dont care
๐
that's how I am/was doing EHE
it's pretty standard for reciprocity, you're basically sending an update from one player to another (or all players)
the version you have is only partially serverside
but will it update the zombies for all the players?
i had something similar on the 1st mod version
and only the target could see the zombies
wasnt syncin' everyone
anyway its worth a shot
it's just weird because I assumed the libraries handled zombie ownership between clients automatically, but I guess it only does it for "its own" zombies.
there's a few things not handled automatically sadly
goes back to the fact they're making a game not a game maker
in another words, they made a game and not an engine to make games
also @pulsar heath have you tested to make sure the horde spawner debug menu has similar issues to what you're experiencing? that code may provide hints on what you're missing, if not. I'm guessing you probably started there though, but just making sure.
Yes, so unless you let them know it probably won't occur to them to have even tested it
wot
since the last update
the horde spawning code is meant for challenges and they even disabled it for dedicated (which is weird cause that means it will still run for multiplayer?)
w0t
unless they disabled it recently or something, the debug one works on dedis
different hordespawning
but spawning zombies works
the debug hordespawns don't get moved
Hey everyone, i'm fiddling around with a mod of my own (it's not big or anything) but the end product would be that certain MultiStageBuild items (such as Metal Wall Lvl1-3) are ignored by the zombies, i can seem to get it working for normal stuff like the Fences and doors, but the Multistagebuild things have gotten me stumped for a while now
the only uses of hordemoveto is in challenges
could it be used though, instead? that's the method I'd hijack-
oh rip, yeah then same issue
so i guess ill go with the frankenstein solution @sour island is using in EHE
I'd guess these use deprecated code, from before some of the migration code got reworked a while back (probably moved into PopMan)
which sucks
i could try to replicate the code in lua... but that will be a pain in the a$$
I'm guessing the condition is in Java, otherwise you'd have just reimplemented it
i could get the zombies from the spawn location and try to use a "nill" sound to atract them?
My guess is that it's a mixup with the server/client entities as we understand them
hmm
since connections have a client and server entity
but the problem is, if theres more zombies at the location they will all come to the player
god dang it
as well as the host (I think?)
could you rebuild the horde move method in Lua, maybe? I can't remember if there's a pathway to the native popman calls from the exposed classes or not
dunno... have no idea how that works
is there a way to set a path to specific zombies?
was more asking Chuck on that one, since he seems to have tinkered with them a little
also, probably not - at least not outside the native popman calls
oh yeah he was messing around with that yesterday for the targetting of the air events
uh idk if thi will work but
ill just go with chuck's solution... send to server send to client
try using virtualzombiemanager?
hmmm that might work... worth a try
this would be a little jank, but if it comes down to it couldn't you just use an inaudible sound to move the zombies around?
the vanilla game does it with lightswitches (if you know, you know) so I assume it'd work
it has a 'createHordeFromTo' which calls on zombiepopmanager...... but maybe it has a different instance?
you'd pull in all the other zombies near by
i thought about that... but its not viable
it will call every zombie in the area affected
true, but wouldn't you want to? wouldn't make sense to have some follow but not others
and the point is to send just the zombies spawned not all in the area
where they spawn
at that point you could just use addSound like EHE does and just create a set of coords as a path
I guess I'm missing the usage here, that sounds a little odd to me
yeah that's precisely what I was thinking
the usage is someone on twitch chat buys a reward with points or bits
and sends the zombies to the player
so it's meant to be immediate?
yup
sure, but if more zombies join in than what was spawned... sounds like more fun to me
you dont stream do ya?
๐
fun for the chat not for the streamer
the point is to give a chance to kill the streamer
not make it 100% dead
plus that gives the chance for someone to spend the minimum to call 5 zombies
but what does it spawn, only like 5 zombies? plus if someone has a base, they'll likely clear out nearby zombies and stuff
and the streamer has to deal with more
it can spawn from 1 to whatever number you set it to
thats up to the streamer
in my case i have 5 10 15 25 40 and 50
what if you just found nearby zombies that are already spawned, and used those instead? and if it doesn't find X amount then it spawns them, and uses sound to move them in?
and how would i control the numnber of zombies?
and what if no zombies are around?
theres a lot of if's
๐
I mentioned that
local zombies = addZombiesInOutfit(x, y, z, 1, outfitID, femaleChance)
for i=0, zombies:size()-1 do
---@type IsoZombie
local zombie = zombies:get(i)
if zombie then
zombie:spotted(player, true)
end
end
luckily, that's precisely what if statements are for! 
sure, I guess I didn't know you weren't up for a challenge ๐
i want to write a mod not a wall of if's ๐
that's more or less what a mod is
yeah i use that to spawn "custom zombies"
yeah you can do this to make the player spotted by these specific zombies
that might just work
the only limitation is they have to be within the cell
it's what I do for SWH aliens
that shouldn't be an issue, cells are huge. if they're on the border of one though... that becomes trickier. or at the corner, even worse
and Spiffo Nemesis spots the closet player in the cell at all times ๐
I just mean it has to be a loaded cell
so a range of 150 should be good
oh okay, that's not bad then
local sourceId = source:getOnlineID();
local ZedQ = tonumber(args.ZedQ);
local Zedx, Zedy, Zedz = SpawnLoc(source)
print("Zedspawn [".. sourceId .."] quant: ", ZedQ)
print("Zedspawn [".. sourceId .."] XY: ", Zedx,Zedy)
print("Zedspawn [".. sourceId .."] PlayerXY: ", source:getX(),source:getY())
--createHordeFromTo(Zedx, Zedy, source:getX(), source:getY(), ZedQ)
local zombies = addZombiesInOutfit(Zedx, Zedy, 0, ZedQ, outfitID, femaleChance)
for i=0, zombies:size()-1 do
---@type IsoZombie
local zombie = zombies:get(i)
if zombie then
zombie:spotted(source, true)
end
end
end
lets see if this works then
would spotted maybe force the popman to give ownership to the player in MP? and then popman would take over? probably still has the same issues as you were saying Chuck, with most stuff not being automatic, but maybe that'd "reassign" them
I don't think spawnHorde returns the zombies as an array
yeah, that's unfortunate - but don't you have to pass it a position?
you could use that pos to get loaded chunks around that position, then get the zombies in it... but then you'd grab others too, so nvm
I think there's other spawn zombie function that don't need an outfit ID
only 2 reacted
this works if i make them spawn really close to the player
which defeats the point kinda
they can't spot you in ghost mode
ghost mode was off
mp
i guess ill have to either try what youre doing for ehe
@tame mulch i remember you mentioned working on the wiki for modding stuff yesterday, could we maybe get some insight into the C/C++ modules? namely PopMan, but the others as well I suppose, if there's nothing sensitive in them.
full source would be amazing, but otherwise just some info on the details of the native methods in there would be super helpful to modders
or use the old function of the old mod
which spawned the zombies close to the player, but away enough for him to have time to react
but its more immersive and cool if they act like a wandering horde
and spawn outside the player field of view
since you dont know where they are... you better run... this way the player will see the zombies and can just go the oposite direction
gonna try sending to server a trigger that sends the command to the client
and hope that syncs everyone with the zombies
@pulsar heath Have you tried spawnHorde command ?
I'm pretty sure I succeed doing this while testing things around
@LuaMethod(
name = "spawnHorde",
global = true
)
public static void spawnHorde(float var0, float var1, float var2, float var3, float var4, int var5) {
for(int var6 = 0; var6 < var5; ++var6) {
VirtualZombieManager.instance.choices.clear();
IsoGridSquare var7 = IsoWorld.instance.CurrentCell.getGridSquare((double)Rand.Next(var0, var2), (double)Rand.Next(var1, var3), (double)var4);
if (var7 != null) {
VirtualZombieManager.instance.choices.add(var7);
IsoZombie var8 = VirtualZombieManager.instance.createRealZombieAlways(IsoDirections.fromIndex(Rand.Next(IsoDirections.Max.index())).index(), false);
var8.dressInRandomOutfit();
ZombieSpawnRecorder.instance.record(var8, "LuaManager.spawnHorde");
}
}
}
Yeah
seems to feed into virtual - seems like a good chance
Var1 and 2 are start x and y , 3 and 4 end x and y and int number of z I think
And it works outside of player cell
Kinda cool
yup doesnt work
you'll have to just report this as a feature request / bug(sort of)
the /createhorde
dont remember if the zombies move or not
with that rcon command
or was it /createhorde2 ?!
could you just reimplement the function there? I don't know if VirtualZombieManager is exposed (or if the necessary fields are public)
the /createhorde spawns zombies near the player ... all around him
so thats not the solution
createHordeFromTo didn't work ?
I'm reading through spotted()
in mp nop
sp works perfectly fine
in mp the zombies spawn but dont move to the set xy
Oh ok that's what I had tested then
But i was in sp no idea why it doesn't work in mp
and the /createhorde2 spawns the zombies in a set location
so...
not a solution either
kk, only 1 thing left to do...
ping pong client to server to client
and hope it works
spotted was run for sure serverside?
yup
Commands.TWEEvents = {};
Commands.TWEEvents.Test = function(source, args)
local sourceId = source:getOnlineID();
local Etype = args.Etype;
print("player ID [".. sourceId .."] send: ".. Etype)
end
Commands.TWEEvents.Zedspawn = function(source, args)
local sourceId = source:getOnlineID();
local ZedQ = tonumber(args.ZedQ);
local Zedx, Zedy, Zedz = SpawnLoc(source)
print("Zedspawn [".. sourceId .."] quant: ", ZedQ)
print("Zedspawn [".. sourceId .."] XY: ", Zedx,Zedy)
print("Zedspawn [".. sourceId .."] PlayerXY: ", source:getX(),source:getY())
spawnHorde(Zedx, Zedy, source:getX(), source:getY(), ZedQ)
end
this is on the server side
and thats where i used the code you posted with the spotted
client side
playerChar:Say("x:" .. tostring(ServerEvent.ZedX) .. "y: " .. tostring(ServerEvent.ZedY))
sendClientCommand("TWEEvents", "Zedspawn", ServerEvent); -- Trigger Event from Client to Server```
just to be sure, this is added to onClientCommand right?
oops
--//////////////////////// Snippet Code by Dislaik ////////////////////////
--/////////////////////////////////////////////////////////////////////////
local Commands = {};
Commands.TWEEvents = {};
Commands.TWEEvents.Test = function(source, args)
local sourceId = source:getOnlineID();
local Etype = args.Etype;
print("player ID [".. sourceId .."] send: ".. Etype)
end
Commands.TWEEvents.Zedspawn = function(source, args)
local sourceId = source:getOnlineID();
local ZedQ = tonumber(args.ZedQ);
local Zedx, Zedy, Zedz = SpawnLoc(source)
print("Zedspawn [".. sourceId .."] quant: ", ZedQ)
print("Zedspawn [".. sourceId .."] XY: ", Zedx,Zedy)
print("Zedspawn [".. sourceId .."] PlayerXY: ", source:getX(),source:getY())
spawnHorde(Zedx, Zedy, source:getX(), source:getY(), ZedQ)
end
Commands.TWEEvents.AirEvent = function(source, args)
local sourceId = source:getOnlineID();
print("player ID [".. sourceId .."] TWEvent: ".. args.Etype)
local heli = getFreeHelicopter(args.heli)
heli:launch(source, false)
end
local onClientCommand = function(module, command, source, args) -- Events Constructor.
if Commands[module] and Commands[module][command] then
Commands[module][command](source, args);
end
end
function SpawnLoc(playerChar)
local mx = playerChar:getX();
local my = playerChar:getY();
local mz = playerChar:getZ();
local DistOffset = ZombRand(10,13);
local Operation = ZombRand(1,5);
local logic ={
function() mx = mx + DistOffset end,
function() mx = mx - DistOffset end,
function() my = my + DistOffset end,
function() my = my - DistOffset end
}
logic[Operation]()
return mx,my,mz
end
Events.OnClientCommand.Add(onClientCommand); -- Listening Events from Client side.```
RIP
thats the full code for now on the server side "listen"
baby steps... to make sure everything works
one function at a time ๐
it sucks when you hammer away at an issue but can't find a solution
guess i only have to go with chucks 1st suggestion
feels kinda "dirty"
but if it works i dont care anymore
XD
lol
i know i have to do it... but damn... it just feels wrong...
it's not wrong, it's standard practice for reciprocation between clients
i wouldnt call it standart
it's absolutely standard lol
if i send a command to a server that affects the world
the thing is there is no server
the server should send it to all connected clients
it's peer 2 peer
each connection and host has their own client and server communicating
the commands let to tap into their respective client/server
it's standard even in other engines, even without p2p networking - the client communicates an event to the server, and the server needs to send data out to other clients to make sure they see the same thing on their end
but if you misuse the commands you can end up in the connection's "server" like I did yesterday
dunno why but i get the feeling TIS started building the house from the roof and not from the foundation
...
nope. it's standard.
the connection-> server-> connection, sure
yeah, that's all I mean
need to emphasize the difference between connection and client now
standart having the client ping pong everything that affects the world?
when you attack a zombie it's clientside lol
wouldn't it be connection and player? each connection is "one" but the players can be multiple, aka splitscreen/co-op
the difference here is that the initial process is serverside to begin with
standart is the client issuing a command and the server comunicating to all other clients that command was sent
but since this cant be considered a server
ok ...
I just mean to explain connection and host and how they each have a client and server code
the client... has server code? outside single player? 
as in, isServer() returns true?
on dedicated servers too, or just localhost?
localhost
oh interesting
hold on...
so I'm guessing that applies only in localhost, then, when the client is the server
so a dedicated server behaves differently?
I could also have it backwards and got client stuff on the host
does that mean i have to worry about host server and dedicated server?!
Shouldn't have to - I think it's the same thing
yeah. the game uses a single instance when you use the host option from the main menu, it doesn't start a local dedicated server in the background, I don't think? chuck may know more
I stay away from dedicated
but if what he's saying is true, that seems to be the case
but logically I would expect dedicated to just be running the game with a spoof'd player 0
did you try the command relay?
it works great for what I need
your mod works on dedicated
I don't really know, but I'd guess that's not the case - I think player 0 is the first to join. could be there's a headless client that isn't inside the normal array though - so using index 0 would ignore it
im gonna write the client side events from server
I'll try to recreate the thing again - but I was getting isClient=true in coop-console
and try it out on host and dedicated
which is the console printed from the localhost "server"
if it works ill finish it if not... screw mp and host
I could be talking out my ass tho
guessing is what we can do when modding for this game...
guessing and fishing for code...
kinda like playing the lottery
educated guessing
theres not a set standard on almost anything
the naming logic changes a lot...
and that really annoys the sh!t out of me
I feel more confident talking about the client/server thing realizing my mistake this whole time with EHE
but I still feel like I'm missing something
yeah your bad luck has turned into my good fortune kinda
it's standard practice to not change names of stuff once released ๐
the problem is this is a 10+ year project with evolving goals
but its also standard practice to keep the logic faithful from begining to end
the upper lower case kicks my ass everytime
yes, but skills grow and change - I don't use the same conventions I used to
hopefully they have a true feature freeze during the polish update
and pull the bandaid on that
one thing i have to admit... the game has improved... slowly but surelly
ofcourse, even between .71 to .78, 800 lua files got touched - not even tracking the java files
so i can rage about small details but still... its come a long way since i 1st played the game
@sour island Yesterday when you said Gamespeed was 0 on server how did you get this result ?
If i go on a server and do print(getGamespeed()) i get 1
Cause I used getGameSpeed on the host's server-code
if you're not using a command you're getting the connection's server-code
Oh okk
I think I nailed the terminology
If you use gameSpeed to measure stuff it would break some math
I use math.max(1,speed)
so basicly... my brain is a bit fried with all of this but i think this is what i have to do
-- client side
--//////////////////////// Snippet Code by Dislaik ////////////////////////
--/////////////////////////////////////////////////////////////////////////
local Commands = {};
Commands.TWEEvents = {};
Commands.TWEEvents.Zedspawn = function(source, args)
local sourceId = source:getOnlineID();
local ZedQ = tonumber(args.ZedQ);
local Zedx, Zedy, Zedz = SpawnLoc(source)
print("Zedspawn [".. sourceId .."] quant: ", ZedQ)
print("Zedspawn [".. sourceId .."] XY: ", Zedx,Zedy)
print("Zedspawn [".. sourceId .."] PlayerXY: ", source:getX(),source:getY())
createHordeFromTo(Zedx, Zedy, playerChar:getX(), playerChar:getY(), ZedQ)
end
Events.OnServerCommand.Add(onServerCommand); -- Listening Events from Client side.```
-- server side
local sourceId = source:getOnlineID();
local ZedQ = tonumber(args.ZedQ);
local Zedx, Zedy, Zedz = SpawnLoc(source)
print("Zedspawn [".. sourceId .."] quant: ", ZedQ)
print("Zedspawn [".. sourceId .."] XY: ", Zedx,Zedy)
print("Zedspawn [".. sourceId .."] PlayerXY: ", source:getX(),source:getY())
sendClientCommand("TWEEvents", "Zedspawn", args);
end```
and the trigger
print("------------=Twitch Events: zombies=------------")
playerChar:Say(EventsTable["viewer"] .. " sent " ..EventsTable["zedquant"] .. " zombies")
--local Zedx, Zedy, wz = LSpawnLoc();
local zedquant = tonumber(EventsTable["zedquant"])
local Zedx = playerChar:getX() + 10
local Zedy = playerChar:getY() +10
if isClient() then
ServerEvent = {["Etype"] = "Zedspawn", ["ZedX"] = Zedx, ["ZedY"] = Zedy, ["ZedQ"] = zedquant }
playerChar:Say("x:" .. tostring(ServerEvent.ZedX) .. "y: " .. tostring(ServerEvent.ZedY))
sendClientCommand("TWEEvents", "Zedspawn", ServerEvent); -- Trigger Event from Client to Server
else
createHordeFromTo(Zedx, Zedy, playerChar:getX(), playerChar:getY(), zedquant)
end
end```
this should do it i think
something looks off to me
no lol, I mean you're sending a clientCommand(toServer)
but then you're server isn't sending a serverCommand?
oops
that naming convention trips me up all the time
that's why I say (ToServer) in my head
just copy pasted not in the mood to change the names
local sourceId = source:getOnlineID();
local ZedQ = tonumber(args.ZedQ);
local Zedx, Zedy, Zedz = SpawnLoc(source)
print("Zedspawn [".. sourceId .."] quant: ", ZedQ)
print("Zedspawn [".. sourceId .."] XY: ", Zedx,Zedy)
print("Zedspawn [".. sourceId .."] PlayerXY: ", source:getX(),source:getY())
sendServerCommand("TWEEvents", "Zedspawn", args);
end```
ill change the names b4 i get even more fried
you have the events. in serverside too right?
This will not work if the zombie network manager is just overwriting out of sync directions btw - but I'm hoping initiating it from client should do the trick (ironically)
Well my brain IS fried, i tried a crapton of stuff (and i know my knowledge is a bit limited) but i can't get these damn walls to be ignored by the zombies... the normal walls and fences work fine, but anything Multistage doesn't wanna play ball ๐ฆ
in theory what im trying to do is
the event is triggered sendclientcommand with the actions and values
the server then sendservercommand with the actions and values
and the client executes
createHordeFromTo
am i wrong trying it this way?
so the trigger
print("------------=Twitch Events: zombies=------------")
playerChar:Say(EventsTable["viewer"] .. " sent " ..EventsTable["zedquant"] .. " zombies")
--local Zedx, Zedy, wz = LSpawnLoc();
local zedquant = tonumber(EventsTable["zedquant"])
local Zedx = playerChar:getX() + 10
local Zedy = playerChar:getY() +10
if isClient() then
ServerEvent = {["Etype"] = "Zedspawn", ["ZedX"] = Zedx, ["ZedY"] = Zedy, ["ZedQ"] = zedquant }
playerChar:Say("x:" .. tostring(ServerEvent.ZedX) .. "y: " .. tostring(ServerEvent.ZedY))
sendClientCommand("TWEEvents", "Zedspawn", ServerEvent); -- Trigger Event from Client to Server
else
createHordeFromTo(Zedx, Zedy, playerChar:getX(), playerChar:getY(), zedquant)
end
end```
then the server side
local sourceId = source:getOnlineID();
local ZedQ = tonumber(args.ZedQ);
local Zedx, Zedy, Zedz = SpawnLoc(source)
print("Zedspawn [".. sourceId .."] quant: ", ZedQ)
print("Zedspawn [".. sourceId .."] XY: ", Zedx,Zedy)
print("Zedspawn [".. sourceId .."] PlayerXY: ", source:getX(),source:getY())
sendServerCommand("TWEEvents", "ClientZedspawn", args);
end```
and finally the execution
local sourceId = source:getOnlineID();
local ZedQ = tonumber(args.ZedQ);
local Zedx, Zedy, Zedz = SpawnLoc(source)
print("Zedspawn [".. sourceId .."] quant: ", ZedQ)
print("Zedspawn [".. sourceId .."] XY: ", Zedx,Zedy)
print("Zedspawn [".. sourceId .."] PlayerXY: ", source:getX(),source:getY())
createHordeFromTo(Zedx, Zedy, playerChar:getX(), playerChar:getY(), ZedQ)
end```
i still get the feeling im doing something wrong though
only one way to find out
What happens if you just use the spawnHorde on clientside in MP?
Broadcasting / spawning zeds in the current version is rigid from what I've seen.
If you take a look at how the zombies are spawned via commands, you'll quickly see that method not being exposed.
It's a problem.
If that doesn't work -I'd say try the spotted() again but this time run only the spotted from clientside
I had to expose this for a java patch.
but i still feel this is about the same as just running the function on the clientside
and nobody else will see the zombies
but... ill clean up the code and try it out... just checking if everything is ok
clientcommand get's relayed to all clients if one isn't given as an argument
if they're all going to the same x/y it should be fine
i need to include the target player in the args
instead of having it as a target for the sendservercommand
right?
sendServerCommand("TWEEvents", "ClientZedspawn", args);
sendClientCommand("TWEEvents", "Zedspawn", ServerEvent);
is there one more?
local sourceId = source:getOnlineID();
local ZedQ = tonumber(args.ZedQ);
print("Zedspawn [".. sourceId .."] quant: ", ZedQ)
print("Zedspawn [".. sourceId .."] XY: ", Zedx,Zedy)
print("Zedspawn [".. sourceId .."] PlayerXY: ", source:getX(),source:getY())
sendServerCommand("TWEEvents", "ClientZedspawn", args);
end```
i need to add
local Player = source
i think?
if you don't have 4 argument in a serverCommand() isn't not sending it to only that player
i can use the player xy
or it will spawn for every player that receives the command
or am i just totally fried already
Both spawnHorde() and createZombie().
thats not the point
the createhordefromto
spawns the zombies
they just dont go to xy
the point is to simulate a wandering horde to the player last know location
Zeds always use a client to simulate IIRC.
network zombie manager probably overrides
Like the closest player regardless...?
I believe the server is like a catalog for zombies and they are then assigned to clients to simulate / do things.
Not 100% sure.
Couldnt you call Noise on players location to make zombies wander to players xy?
Why not make all the zombies that aren't your targets deaf and then noise, then undeaf?
I meanโฆ added challenge xD
not viable... someone spends enough to buy 5 zombies
and the streamer gets 50
๐
talk about a bargain
You're doing Twitch integration?
I would like that as a viewer
Forgot to update my custom lua commands patch to 78.
I already did this half a year back for someone.
wait you dont use keypresses?
nop
read from text?
i made a twitch api lib in c#
and use that to relay the json to the lua
via a file in the lua folder
then i made an shitty app in vbnet
just to have a UI for it
Here's an example of my implementation: https://github.com/asledgehammer/ExtraCommands/blob/master/media/lua/server/cmd_windows.lua
Sorry for the delay and for the braindead english, early in the morning still havent had my coffee but its better than no tutorial. Bellow is the url you can use if you follow this tutorial to get the access token from https://dev.twitch.tv/
easy to use
just set up the rewards on your channel
and then config the triggers in the app
thats all you need to do
working 100% on sp
Neat.
the previous version needed something to send the keypresses
Custom commands are useful in more ways than Twitch so I implemented this way.
and i still need to finish the discord bot
.... to much to do ...
you can still use the mod with another app, as long as it can write to files
the thing is... the app checks if the file is empty b4 writing
and queues everything
If yours does the same functions but better
or i can just make it work either with my mod or yours
or with both
no point in scrapping your mod... not everyone wants all the events i have on my mod
some ppl just want the EHE events
function twitchIntegration_OnKeyPressed(key)
...
sendClientCommand("twitchIntegration", "scheduleEvent", {twitchKey=twitchKey,presetConfigNum=presetConfigNum,twitchTarget=pUsername})
...
i think i got it sorted
local function onCommand(_module, _command, _player, _event)
...
eHeliEvent_new(startDay, startTime, presetID, _event.twitchTarget)
this is going to be the new implementation for twitch events going forward as well as the debug tests
a few people don't know or want to set up the keystroke events thing
oh you still need to use that?
the app just writes this
{"Viewer": "VIEWER", "Status": "UNFULFILLED", "title": "TITLE", "zombies": true, "zedquant": 0, "gifts": 0, "helicopter": 0, "gas": false, "tire": false, "muffler": false, "battery": false, "engine": false, "trait": 0}
into rewards.txt
so no need for TP
the mod then parses the file and clears it
if the file is empty the app then writes the next rewards string into the file
and so on till the queue is empty
I feel like you could make this an API and send it to TIS lol
the first try i had with integration was with 7dtd
the fun pimps actually listened to the community
and made it native
there were several "user mods" for twitch
and all were crap... including mine
the way they did is very very good
mine relies on reward points and bits
when twitch blew up PZ it was briefly mentioned it was being looked into
like the twitch stats mod i made... i wanted to stream pz but was getting sick and tired of the same questions
I'm not as verbose in how twitch works but I knew you could simulate keystrokes cause djackz was using touchportal to make Q work
so I used numpad since it's not really used
yeah but touch portal is not very user friendly for some stuff
I'd be curious if I could tie it to non existent keys
you can and you cant
but not having to use touchportal would be nice
i tried that but pz just refuses to work with that key
just says unkown key gl something key code
you probably have to register it
fair enough
i think the way im doing it its more user friendly
you just create the rewards on twitch
open the app, list the rewards, click on it and checkmark what you want
and fill the values for quant if needed
thats about it
anyway to feed in custom made stuff?
yeah
you can feed whatever you want
if its not twitch related i have a "backdoor"
to send custom json to it
and anything i want i can just add it to the code and recompile it anyway
I'd just be curious if I could offer it but if people can use either mod that's fine
I've seen some people forgo touchportal and manually activate events too ๐
i made it to work with my mod alone, or with yours alone
nice
the first tests i did was with yours
then from that i started working on mine and added it to the app
now i need to finish the piggybacking on your conditional speech mod
and add a section for the events from twitch
been messing around with it in the last few days but mp... is the priority for now
and i also need to "close" the app and make an installer
plus a version checker for whnever i update it
but thats something for the future me to worry about
the present me only wants to fix the damn mp zombie spawning...
everything else works
I think cndspeech still has issues in MP
the bit i tested worked fine... added a section on my mod for the twitch events
the issue I mean is that others don't see it?
and hacked a function to get some stuff from your mod
but end-users can be very hard to trust with reports
you have to either use the radio
for everyone to see
or what was it...
there was another thing someone told me about cant quite remember
I stopped using "radio" as a parameter in say()
I'll probably revisit it sooner or later
cnd speech imho is a SP mod lol
although hacking another player to see him scream is pretty funny
makes no diference if only the player itself can see it
and im to lazy to try and make the logic you made for the phrases and stuff
๐
so i just leech from it and make it a required mod
win win... whoever subs mine has to sub yours
so you make them say random things or?
so i can have a set of phrases based on the type of event
like mix angry with the say i want when someone does something negative
like someone sends a bunch of zombies
or send a bad gift ( stack of logs )
and based on the type of giftim trying to "leech" from your mod
to set the "mood" of the say
so if someone sends a bad gift ill trigger something using your sarcasm parameters but with the set of phrases i made for my mod
basicly im trying to use your mod as a "framework"
i wish i had thought of that with my first integration mod
i wouldnt have to rewrite it from scratch ๐
but it started with a mod for my personal use
wasnt made to public use...
this time i even have documentation for whoever wants to change it branch or use it with keypresses via TP
๐
When I wrote named literature I basically made every single possible thing it's own function focusing on making it a framework
when I added the other literature types it was fairly easy
biggest hurdle was supporting non-named literature items
which required some serious refactoring
i had the functions running on the keypress event
so it was a wall of code
messy and unreadable
wasn't expecting to support non-named items in a mod about named literature ๐
I need to figure out how to sync my zombies
Zedx = playerChar:getX()
Zedy = playerChar:getY()
print("xy ", Zedx,Zedy)
createHordeFromTo(Zedx, Zedy, playerChar:getX(), playerChar:getY(), 1)```
doing this on clientside does nothing in mp
doesnt even spawn the zombie ๐
oh such fun
even this createHordeFromTo(Zedx, Zedy, Zedx,Zedy, 1) nothing ๐
I might do another deep dive on Lua's 5.1 syntax.
this is weird
client side nothing happens
server side they spawn but dont move :d
wth
I might want to take a stab at interpreting Lua 5.1 as ES5 JavaScript logic.
i guess ill just add them far enough for the player to react
and be done with it
just need to change the loc randomizer
to take in values
Am sort of down the path to transpiling Lua as Typescript.. Might as well explore making it fully.
instead of using fixed values
never worked with typescript... the 1st thing my brain clicks with typescript is font formatting ๐
Two transpilers on my hands.. This one will be a third one.
Let's have an intervention
Lua is much like ES5 JS so it's doable.
so where do i post a "feature request"
Forums I suppose - tech support if it can be considered a bug
hmm it is a bug... kinda
I usually dm Nasko with details - but I probably shouldn't ๐
ill post in the forum
I think that you workshop ranks here should have the ability to vote on issue priorities for these requests.
It might filter odd requests and also allow for input from modders.
AFAIK Many issues and requests aren't getting attention that may help out the community. =/
(Voting doesn't mean accepting something in my proposal here)
I think there's priorities to focus on the roadmap
I'm crossing my fingers on the polish update tho
Why you need guide about c++ pz stuff?
@sour island I run print(getGameSpeed()) on a dedicaced server from files in server/ folder and I get this
but are you using a command?
@tame mulch can i ask you a question?
It is in server/ folder
doesn't matter
It should be run by the server as I'm in mp no ?
I'd be down for that. Apart from using Ghidra on PZ's DLL files, not having access to stuff like Java decompiling is unfortunate. I'd have to DISASM and intercept-mod your DLLs if I wanted to that bad.
Yep
I'd have to hardcore mod your machine code. xD
the function createHordeFromTo only works on sp, is there any way to use something similar in mp/host?
Will animals fly?
I just don't see TIS even considering encouraging modding their DLLs.
(Security and IP reasons)
to be more precise it works on MP/Host as well but the zombies dont move to the specified XY
I'll add '"getGameSpeed:"..getGameSpeed()' to my print test
It'd be fun modifying lighting though...
I think the issue is that function goes to zombiemanager rather than virtualzombiemanager as the others do
But this is a rough guess - the actual movement manager stuff isn't shown in java
A wall that I hit as a consequence of the C++ code wall is not being able to apply alpha or "dimming" effect for IsoRoomLight.
