#mod_development

1 messages ยท Page 101 of 1

pulsar heath
#

moving the player or the markers?

sour island
#

player

craggy depot
#

I guess im far from being able to formulate that in PZ terms, but when i know more i may come back and ask

pulsar heath
#

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?

red tiger
sour island
pulsar heath
#

maybe try to set a final point to move after flying over the player object?

sour island
#

I think it's related to the jet's speed

pulsar heath
#

thats how i fixed the zombie spawn to last known player location... they sometimes wouldnt react to anything after getting there

craggy depot
pulsar heath
#

sometimes they would react normally

red tiger
#

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.

sour island
#

trying to make AI that specific might require you to make all your zombies blind and actually apply your own AI entirely

craggy depot
sour island
#

in terms of nesting and avoiding light/daylight

craggy depot
pulsar heath
#

avoiding light is not that hard

#

the nesting bit...

craggy depot
red tiger
#

Well anyone judging you right now is a straight-up meanie. I'm saying to have fun and go wild.

craggy depot
#

the zombies wouldnt change

pulsar heath
#

make zombies go to a random nearby building even i can do that

sour island
#

I feel like making zombies not step outdoors but still be aggressive indoors is pretty complicated lol

pulsar heath
#

a bit, but not that hard

sour island
#

you could use isoPlayers... ๐Ÿ˜ฎ

craggy depot
#

Or at least not that much. Vampires would have few new features but it would be like superstrong sprinter

pulsar heath
#

i have a script somewhere that they react only if the player touches them when inside a building

#

a failed project ๐Ÿ˜„

pulsar heath
#

i ended up not having the time to do it neither or the patience

fast galleon
#

attract zombies to building by turning on / off the lights, lol

pulsar heath
#

na i used the game time

#

plus if it was raining or snowing ( = sun hidden )

sour island
#

hmm the jets getting stuck only happens in MP

pulsar heath
#

they would come out

craggy depot
pulsar heath
#

yeah but its unrealiable code

craggy depot
pulsar heath
#

like @sour island said... you probably have to make your own AI logic and make the zombies blind

sour island
#

Totally doable, just alot of work

craggy depot
sour island
#

using isoPlayers might be more fun

#

not sure how zombies would react to that though

pulsar heath
#

hmm make the vampires player like npcs?

#

kinda like superb survivors?

craggy depot
craggy depot
pulsar heath
#

more like you can have your own separate "entity" that you can manipulate without having to do the same for all the zombies

craggy depot
pulsar heath
#

keeping the zombies following the normal game AI

sour island
#

the object players use

pulsar heath
#

and only having the vampires react to the sun

craggy depot
pulsar heath
#

that way youll only need to worry about the vampires ai

#

still a lot of work...

craggy depot
craggy depot
#

How its called

fast galleon
#

this would be worse?

craggy depot
#

As in to use the methods for running, jumping fences etc?

#

and giving it to the vamps to create the logic right?

sour island
#

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

craggy depot
#

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

sour island
#

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

rancid panther
#

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

chilly ledge
#

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

vast veldt
#

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).

sour island
#

you can use instanceof(obj,"type") if you know the type and want to confirm

vast veldt
#

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.

bronze yoke
#

usually you identify them by sprite in this situation

sour island
#

if you need the type from an IsoObject I use local type = tostring(isoObject):match('[^.]+$'):match("(.-)@")

#

afaik getClass() may not work outside of debugmode

vast veldt
#

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.

sour island
#

or atleast getClass():simplename()

chilly ledge
#

Does anyone know which table I need to insert into to forcibly add a peice of clothing to ALL zombie outfits?

sour island
#

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?

chilly ledge
#

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

sour island
#

was there any issues with that approach?

chilly ledge
#

Not sure, I could see it possibly having some issues (namely it replaces underwear)

#

I'll give that a try

glacial viper
#

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

sour island
#

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

fair current
#

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?

glacial viper
red tiger
#

Oh man.. I'm staring into the void in terms of projects I could work on...

#

An analytical transpiler for Lua. :X

#

Gosh darnit.

fresh geyser
#

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.

nova socket
#

Does server store getModData on its side or its a client thing only?

nova socket
ancient grail
ancient grail
willow estuary
#

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.

ancient grail
#

What about the animations

#

setVariable

willow estuary
#

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 ๐Ÿคท

tame mulch
drifting ore
#

@here

#

nice

ancient grail
nova socket
#

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

bronze yoke
#

isocell is not a map object

#

isocell represents the loaded area, it has nothing to do with mapping 'cells'

tame mulch
nova socket
#

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.

willow estuary
#

If you search the vanilla code there are many examples of IsoObject usage as well ๐Ÿ™‚

brisk notch
nova socket
willow estuary
#

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.

bronze yoke
#

getSquare(x, y, z)

nova socket
#

Server-side knows that too?

nova socket
# willow estuary It absolutely must be within 150 tiles or something? of an actual instance of a ...

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?

willow estuary
#

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.

nova socket
#

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.

willow estuary
#

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 ๐Ÿ™‚

nova socket
#

Oh wait, you can check square validity? That would be even better, ty.

willow estuary
#

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.

nova socket
#

Thanks I got some idea now how cell and square exactly related .

willow estuary
#

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

nova socket
#

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 KEKCrash

cosmic condor
willow estuary
cosmic condor
dark wedge
#

RIP that I got rick-rolled from the wiki. drunk

cosmic condor
#

some people can remember the url dQw4w9WgXcQ

willow estuary
# nova socket Yeah that's nice, because its probably not a good idea trying to construct a who...

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?

weak sierra
#

insignificant overhead

#

if you do actual checks in the onloadgridsquare then it gets.. way worse

gaunt meteor
#

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

sour island
sour island
ancient grail
#

Ye

sour island
#

I haven't tested what getorsetsquare does with squares outside of the technical cell - I'm hoping it corrects with saving

hollow current
#

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");

golden sparrow
hollow current
hollow current
sour island
hollow current
#

It's the same as what I've done

#

TraitFactory.setMutualExclusive("Desensitized", "Hemophobic");

fast galleon
#

is your function done OnGameBoot?

hollow current
#

Yup, that was the issue

#

I created a function and added it into OnGameBoot, error is gone now

#

Thanks โค๏ธ

fast galleon
#

@hollow current
That means that you need to require every mod file that overwrites that trait now stressed

jaunty marten
hollow current
#

I followed the way More Traits mod did it

fast galleon
hollow current
#
require('NPCs/MainCreationMethods');
function(functionname)
  code block
end

Events.OnGameBoot.Add(functionname);```
#

hmm okay

#

what's the function to wait? never used it before

jaunty marten
#

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);
fast galleon
#

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.

jaunty marten
fast galleon
#

Is the OnTick running on MainMenu, maybe you need a different event

jaunty marten
#

I think much other devs don't give a shit about more compatibility

jaunty marten
#

btw I'm not sure if is OnTick don't call in main menu

#

never tried

hollow current
#

ye FETick for main menu

fast galleon
jaunty marten
fast galleon
#

no idea, just saying... sometimes you don't need to care about every ๐Ÿ’ฉ

jaunty marten
#

yeah, facts-facts

nova socket
ancient grail
#

Maybe rcon is logged in as a player lol idk

pulsar heath
#

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?

ancient grail
#

da fuq have i done

void fractal
pulsar heath
#

๐Ÿ˜„

pulsar heath
#

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

blissful canopy
#

anyone knows what does this class do?

wraith dew
#

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.

ancient grail
ancient grail
wraith dew
ancient grail
ancient grail
wraith dew
#

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.

ancient grail
#

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

wraith dew
#

Thank you again, I will try this weekend.

ancient grail
#

๐Ÿซก

blissful canopy
#

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?

pulsar heath
#

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

sour island
#

hm?

pulsar heath
#

im triggering the getFreeheli something

#

from the server side

#

and i just get this

#

a sec gonna trigger it again

sour island
#

it won't work until I update it

#

there's a few things going on

pulsar heath
#

but i can triggered it client side right?

sour island
#

the servr side events don't update due to gametime being 0 serverside

pulsar heath
#

it will upate the other players?

sour island
#

Yes, it can be activated client side - as in the debug commands

sour island
#

It's already changed

#

just leave it as serverside on your end - Ill let you know once the update is out

pulsar heath
#

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

pulsar heath
sour island
#

alrighty

pulsar heath
#

but the createHordeFromTo(Zedx, Zedy, source:getX(), source:getY(), ZedQ) is making no sense

sour island
#

?

pulsar heath
#

the zombies spawn but dont move to the xy

sour island
#

where do they spawn to? nothingness?

pulsar heath
#

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 )

sour island
#

oh I didn't know that was a thing

pulsar heath
#

on mp, they just stand there

sour island
#

oh this is your own thing

pulsar heath
#

no no its a function in the game

sour island
#

o.o

#

and you're verifying they are spawned just not moving?

pulsar heath
#

yup

#

at first i thought they didnt spawn

sour island
#

is the location very far out?

pulsar heath
#

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

sour island
#
   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...

pulsar heath
#

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 )

sour island
#

ghost mode doesn't stop ai moving in SP?

pulsar heath
#

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

sour island
#
Challenge1.SpawnZombies = function(count)
-- init wave...
    if getCore():isDedicated() then return end

pulsar heath
#

first arg pairs

sour island
#

might be a reason they disabled the challenge in MP

pulsar heath
#

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

sour island
#

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?

pulsar heath
#

server side

#

this is new

#

the marker has the offset broken?!

#

let me try another event

sour island
#

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

pulsar heath
#

right now very close to the player

#

max zoom out on the edge of the screen

sour island
#

try 40-50

#

just to confirm

pulsar heath
#

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

sour island
#

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( ?

pulsar heath
#

most likely

fast galleon
pulsar heath
#

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?

sour island
#
   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);
      }
   }
finite radish
# sour island but I think the n_ is perhaps a way to call 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++

sour island
#

seems like spawning hordes creates an XML?

pulsar heath
#

hmmm

sour island
#

also I don't actually see the part where they tell the zombies to move

pulsar heath
#

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);
}
}

finite radish
#

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

pulsar heath
#

thats the function im using

#

the question is...

sour island
#

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

pulsar heath
#

english today is not working for me

#

i meant thats what the function im using "calls"

sour island
#

yes

finite radish
#

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

pulsar heath
#

but why does it work in sp and not in mp?

#

half works in mp

sour island
#

the problem is native doesn't use hordespawning in MP

pulsar heath
#

the zombies spawn

#

but dont move

sour island
#

they do go after you though?

#

like they chase you?

pulsar heath
#

if im not in ghost mode yeah

sour island
#

the issue is they don't get told to move?

pulsar heath
#

they react to me

sour island
#

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?

finite radish
#

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

sour island
#

call a serverCommand within the clientCommand to see if that fixes the moving

pulsar heath
#

they react normaly to everything in the world

#

including the heli

#

or player

#

its like the instrunction to move to xy is not triggering

finite radish
#

oh, you're trying to move them manually?

sour island
#

no, there's a vanilla function that spawns and moves a horde

#

they don't move in MP

finite radish
#

ah okay, I see

pulsar heath
sour island
#

I'm surprised this function is even a thing - I was going to try to do a roaming horde mod next ๐Ÿ˜…

finite radish
#

are you calling it on the server?

pulsar heath
#

yup

sour island
#

try what I said above

#

I've done it before

pulsar heath
#

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

sour island
#

it's a bit hackish but if it works ๐Ÿคทโ€โ™‚๏ธ

pulsar heath
#

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

#

๐Ÿ˜„

sour island
#

that's how I am/was doing EHE

finite radish
#

it's pretty standard for reciprocity, you're basically sending an update from one player to another (or all players)

sour island
#

the version you have is only partially serverside

pulsar heath
#

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

finite radish
#

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.

sour island
#

there's a few things not handled automatically sadly

#

goes back to the fact they're making a game not a game maker

pulsar heath
#

in another words, they made a game and not an engine to make games

finite radish
#

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.

sour island
#

Yes, so unless you let them know it probably won't occur to them to have even tested it

pulsar heath
#

cant use the debug menu

#

the game refuses to work

finite radish
#

wot

pulsar heath
#

since the last update

sour island
#

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

finite radish
sour island
#

different hordespawning

pulsar heath
#

but spawning zombies works

sour island
#

the debug hordespawns don't get moved

fringe ridge
#

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

sour island
#

the only uses of hordemoveto is in challenges

finite radish
#

could it be used though, instead? that's the method I'd hijack-

oh rip, yeah then same issue

pulsar heath
#

so i guess ill go with the frankenstein solution @sour island is using in EHE

finite radish
#

which sucks

sour island
#

nah it is using popman calls

#

the 'if dedicated' is probably really old

pulsar heath
#

i could try to replicate the code in lua... but that will be a pain in the a$$

finite radish
pulsar heath
#

i could get the zombies from the spawn location and try to use a "nill" sound to atract them?

sour island
#

My guess is that it's a mixup with the server/client entities as we understand them

pulsar heath
#

hmm

sour island
#

since connections have a client and server entity

pulsar heath
#

but the problem is, if theres more zombies at the location they will all come to the player

#

god dang it

sour island
#

as well as the host (I think?)

finite radish
#

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

pulsar heath
#

dunno... have no idea how that works

#

is there a way to set a path to specific zombies?

finite radish
#

was more asking Chuck on that one, since he seems to have tinkered with them a little

finite radish
pulsar heath
#

oh yeah he was messing around with that yesterday for the targetting of the air events

sour island
#

uh idk if thi will work but

pulsar heath
#

ill just go with chuck's solution... send to server send to client

sour island
#

try using virtualzombiemanager?

pulsar heath
#

hmmm that might work... worth a try

finite radish
#

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

sour island
#

it has a 'createHordeFromTo' which calls on zombiepopmanager...... but maybe it has a different instance?

sour island
pulsar heath
#

it will call every zombie in the area affected

finite radish
pulsar heath
#

and the point is to send just the zombies spawned not all in the area

#

where they spawn

sour island
#

at that point you could just use addSound like EHE does and just create a set of coords as a path

finite radish
#

I guess I'm missing the usage here, that sounds a little odd to me

finite radish
pulsar heath
#

the usage is someone on twitch chat buys a reward with points or bits

#

and sends the zombies to the player

sour island
#

so it's meant to be immediate?

pulsar heath
#

yup

finite radish
#

sure, but if more zombies join in than what was spawned... sounds like more fun to me

sour island
#

oooh

#

I thought you wanted roaming hordes

pulsar heath
#

๐Ÿ˜„

#

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

finite radish
#

but what does it spawn, only like 5 zombies? plus if someone has a base, they'll likely clear out nearby zombies and stuff

pulsar heath
#

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

finite radish
#

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?

fringe ridge
#

yeah chat loves messing with streamers XD

#

i'm all too familiar XD

pulsar heath
#

and how would i control the numnber of zombies?

#

and what if no zombies are around?

#

theres a lot of if's

#

๐Ÿ™‚

finite radish
#

I mentioned that

sour island
#
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
finite radish
pulsar heath
#

i said thats a lot of ifs

#

didnt say it wasnt doable ๐Ÿ˜„

#

that might work chuck

finite radish
#

sure, I guess I didn't know you weren't up for a challenge ๐Ÿ˜

pulsar heath
#

i want to write a mod not a wall of if's ๐Ÿ˜„

finite radish
#

that's more or less what a mod is

sour island
#

the 1 should be n

#

as in how many you want

#

let me confirm

pulsar heath
#

yeah i use that to spawn "custom zombies"

sour island
#

yeah you can do this to make the player spotted by these specific zombies

pulsar heath
#

that might just work

sour island
#

the only limitation is they have to be within the cell

pulsar heath
#

let me try it

#

a sec

sour island
#

it's what I do for SWH aliens

finite radish
sour island
#

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

finite radish
#

oh okay, that's not bad then

pulsar heath
#
    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

sour island
#

the true in spotted relates to spot time

#

seems to multiply it by 10000

finite radish
#

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

sour island
#

I don't think spawnHorde returns the zombies as an array

finite radish
#

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

sour island
#

I think there's other spawn zombie function that don't need an outfit ID

pulsar heath
#

only 2 reacted

#

this works if i make them spawn really close to the player

#

which defeats the point kinda

sour island
#

they can't spot you in ghost mode

pulsar heath
#

ghost mode was off

sour island
#

oh

#

this was in MP or SP?

pulsar heath
#

mp

sour island
#

I think something is superseding it

#

that means my AI probably are broken in MP too

pulsar heath
#

i guess ill have to either try what youre doing for ehe

finite radish
#

@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

pulsar heath
#

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

golden sparrow
#

@pulsar heath Have you tried spawnHorde command ?

pulsar heath
#

that doesnt make them go to xy

#

just spawns them in xy

golden sparrow
#

I think it does ?

#

You can set a start x,y and end x,y if i rememver well

pulsar heath
#

i can try

#

sec

golden sparrow
#

I'm pretty sure I succeed doing this while testing things around

pulsar heath
#

it does take the same arg's

#

ill give it a shot

sour island
#
      @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");
            }
         }

      }
golden sparrow
#

Yeah

sour island
#

seems to feed into virtual - seems like a good chance

golden sparrow
#

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

sour island
#

uhhh

#

nah it's not start and end

#

it's a spread

#

x1 y1 x2 y2

pulsar heath
#

yup doesnt work

sour island
#

you'll have to just report this as a feature request / bug(sort of)

pulsar heath
#

the /createhorde

#

dont remember if the zombies move or not

#

with that rcon command

#

or was it /createhorde2 ?!

finite radish
#

could you just reimplement the function there? I don't know if VirtualZombieManager is exposed (or if the necessary fields are public)

pulsar heath
#

the /createhorde spawns zombies near the player ... all around him

#

so thats not the solution

golden sparrow
#

createHordeFromTo didn't work ?

sour island
#

I'm reading through spotted()

pulsar heath
#

in mp nop

#

sp works perfectly fine

#

in mp the zombies spawn but dont move to the set xy

golden sparrow
#

Oh ok that's what I had tested then

#

But i was in sp no idea why it doesn't work in mp

pulsar heath
#

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

sour island
#

spotted was run for sure serverside?

pulsar heath
#

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```
finite radish
pulsar heath
#

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.```
fringe ridge
#

RIP

pulsar heath
#

thats the full code for now on the server side "listen"

#

baby steps... to make sure everything works

#

one function at a time ๐Ÿ™‚

fringe ridge
#

it sucks when you hammer away at an issue but can't find a solution

pulsar heath
#

guess i only have to go with chucks 1st suggestion

#

feels kinda "dirty"

#

but if it works i dont care anymore

sour island
#

I just realized I had my caloric burn mod adding calories for carrying heavy stuff

fringe ridge
#

XD

pulsar heath
#

so if you carry weight you get fatter and not slimmer

#

๐Ÿ˜„

finite radish
#

suddenly anyone who works for a moving company is 600 lbs

pulsar heath
#

lol

fringe ridge
#

haha

#

Body Builders start gaining fat instead of muscle

pulsar heath
#

i know i have to do it... but damn... it just feels wrong...

finite radish
pulsar heath
#

i wouldnt call it standart

finite radish
#

it's absolutely standard lol

pulsar heath
#

if i send a command to a server that affects the world

sour island
#

the thing is there is no server

pulsar heath
#

the server should send it to all connected clients

sour island
#

it's peer 2 peer

pulsar heath
#

i keep forgeting about that

#

p2p...

#

....

sour island
#

each connection and host has their own client and server communicating

#

the commands let to tap into their respective client/server

finite radish
#

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

sour island
#

but if you misuse the commands you can end up in the connection's "server" like I did yesterday

pulsar heath
#

dunno why but i get the feeling TIS started building the house from the roof and not from the foundation

#

...

finite radish
#

nope. it's standard.

sour island
#

the connection-> server-> connection, sure

finite radish
#

yeah, that's all I mean

sour island
#

need to emphasize the difference between connection and client now

pulsar heath
#

standart having the client ping pong everything that affects the world?

sour island
#

when you attack a zombie it's clientside lol

finite radish
sour island
#

the difference here is that the initial process is serverside to begin with

pulsar heath
#

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 ...

sour island
finite radish
#

the client... has server code? outside single player? PepoThink

sour island
#

yes...

#

I stumbled into it

finite radish
#

as in, isServer() returns true?

sour island
#

yeah

#

I mismanaged by commands

finite radish
#

on dedicated servers too, or just localhost?

sour island
#

localhost

finite radish
#

oh interesting

pulsar heath
#

hold on...

finite radish
#

so I'm guessing that applies only in localhost, then, when the client is the server

pulsar heath
#

so a dedicated server behaves differently?

sour island
#

I could also have it backwards and got client stuff on the host

pulsar heath
#

does that mean i have to worry about host server and dedicated server?!

sour island
#

Shouldn't have to - I think it's the same thing

finite radish
sour island
#

I stay away from dedicated

finite radish
#

but if what he's saying is true, that seems to be the case

pulsar heath
#

but my mod is meant to work on dedicated and host

#

god dang it

sour island
#

but logically I would expect dedicated to just be running the game with a spoof'd player 0

pulsar heath
#

screw the mp

#

i give up

#

sp... whoever wnats it mp, code it

sour island
#

did you try the command relay?

pulsar heath
#

nop ๐Ÿ˜„

#

but it should work

sour island
#

it works great for what I need

pulsar heath
#

your mod works on dedicated

finite radish
pulsar heath
#

im gonna write the client side events from server

sour island
#

I'll try to recreate the thing again - but I was getting isClient=true in coop-console

pulsar heath
#

and try it out on host and dedicated

sour island
#

which is the console printed from the localhost "server"

pulsar heath
#

if it works ill finish it if not... screw mp and host

sour island
#

I could be talking out my ass tho

pulsar heath
#

guessing is what we can do when modding for this game...

#

guessing and fishing for code...

#

kinda like playing the lottery

sour island
#

educated guessing

pulsar heath
#

theres not a set standard on almost anything

#

the naming logic changes a lot...

#

and that really annoys the sh!t out of me

sour island
#

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

pulsar heath
#

yeah your bad luck has turned into my good fortune kinda

sour island
#

it's standard practice to not change names of stuff once released ๐Ÿ˜…

#

the problem is this is a 10+ year project with evolving goals

pulsar heath
#

but its also standard practice to keep the logic faithful from begining to end

#

the upper lower case kicks my ass everytime

sour island
#

yes, but skills grow and change - I don't use the same conventions I used to

pulsar heath
#

it was aBcd now its Abcd

#

that really messes me up

sour island
#

hopefully they have a true feature freeze during the polish update

#

and pull the bandaid on that

pulsar heath
#

one thing i have to admit... the game has improved... slowly but surelly

sour island
#

ofcourse, even between .71 to .78, 800 lua files got touched - not even tracking the java files

pulsar heath
#

so i can rage about small details but still... its come a long way since i 1st played the game

golden sparrow
#

@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

sour island
#

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

golden sparrow
#

Oh okk

sour island
#

I think I nailed the terminology

golden sparrow
#

I'll try cause if its the case my mod doesn't work in mp

#

lmao

sour island
#

If you use gameSpeed to measure stuff it would break some math

#

I use math.max(1,speed)

pulsar heath
#

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

sour island
#

something looks off to me

pulsar heath
#

the + 10

#

๐Ÿ˜„

#

or is it something else?

sour island
#

no lol, I mean you're sending a clientCommand(toServer)

#

but then you're server isn't sending a serverCommand?

pulsar heath
#

oops

sour island
#

that naming convention trips me up all the time

#

that's why I say (ToServer) in my head

pulsar heath
#

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

sour island
#

you have the events. in serverside too right?

pulsar heath
#

yup

#

ill write it properly and post it just a sec

sour island
#

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)

fringe ridge
#

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 ๐Ÿ˜ฆ

pulsar heath
#

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

sour island
#

What happens if you just use the spawnHorde on clientside in MP?

pulsar heath
#

it spawns the zombies

#

but only the player targeted can see them

sour island
#

ah ok

#

cause they aren't spawned for the other clients

red tiger
#

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.

sour island
#

He's trying to use the spawnHordeToXY function

#

but it's not designed for MP

red tiger
#

Yeah.

#

There is MP code but it's not exposed.

sour island
#

If that doesn't work -I'd say try the spotted() again but this time run only the spotted from clientside

red tiger
#

I had to expose this for a java patch.

pulsar heath
#

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

sour island
#

clientcommand get's relayed to all clients if one isn't given as an argument

pulsar heath
#

b4 testing

#

hmmm

#

so i need to change some stuff still

sour island
#

if they're all going to the same x/y it should be fine

pulsar heath
#

i need to include the target player in the args

#

instead of having it as a target for the sendservercommand

#

right?

sour island
#

uhhh

#

you don't have a player as an argument in either command call

pulsar heath
#

source = player object

#

at least when i send it to server

sour island
#

sendServerCommand("TWEEvents", "ClientZedspawn", args);
sendClientCommand("TWEEvents", "Zedspawn", ServerEvent);

#

is there one more?

red tiger
#

Ooooo

#

spawnHorde() is in Global API.

pulsar heath
#
    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?

sour island
#

if you don't have 4 argument in a serverCommand() isn't not sending it to only that player

pulsar heath
#

as in args.player = source

#

so that on the other side ( client )

red tiger
#

The server command logic is the same as spawnHorde() btw

#

Was this used?

pulsar heath
#

i can use the player xy

#

or it will spawn for every player that receives the command

#

or am i just totally fried already

red tiger
#

Both spawnHorde() and createZombie().

pulsar heath
#

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

red tiger
#

Oh you're dealing with pathing.

#

Good luck.

pulsar heath
#

i wonder why it works 100% fine in sp

#

and in mp only spawns the zombies

red tiger
#

Zeds always use a client to simulate IIRC.

sour island
#

network zombie manager probably overrides

red tiger
#

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.

neon bronze
#

Couldnt you call Noise on players location to make zombies wander to players xy?

pulsar heath
#

not viable

#

it will call all the zombies

#

not just the spawned ones

red tiger
#

Why not make all the zombies that aren't your targets deaf and then noise, then undeaf?

pulsar heath
#

because that will "break" the game for everyone else on the server

#

kinda

neon bronze
pulsar heath
#

not viable... someone spends enough to buy 5 zombies

#

and the streamer gets 50

#

๐Ÿ˜„

#

talk about a bargain

red tiger
#

You're doing Twitch integration?

neon bronze
#

I would like that as a viewer

pulsar heath
#

its done

#

just working on the mp bit

red tiger
#

Forgot to update my custom lua commands patch to 78.

#

I already did this half a year back for someone.

pulsar heath
#

the 1st version i made it around 2 years ago

#

it used keypresses which sux

sour island
#

wait you dont use keypresses?

pulsar heath
#

nop

red tiger
#

Oh. I use RCON and a generic command solution to forward to Lua.

#

(For both SP and MP)

sour island
#

read from text?

pulsar heath
#

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

red tiger
pulsar heath
#

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

red tiger
#

Neat.

pulsar heath
#

the previous version needed something to send the keypresses

red tiger
#

Custom commands are useful in more ways than Twitch so I implemented this way.

pulsar heath
#

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

sour island
#

this is neat

#

Might scrap my twitch mod ๐Ÿ˜…

pulsar heath
#

why?

#

i can just give you the source code for the app

sour island
#

If yours does the same functions but better

pulsar heath
#

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

sour island
#
function twitchIntegration_OnKeyPressed(key)
...
    sendClientCommand("twitchIntegration", "scheduleEvent", {twitchKey=twitchKey,presetConfigNum=presetConfigNum,twitchTarget=pUsername})
...
pulsar heath
#

i think i got it sorted

sour island
#
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

pulsar heath
#

yup

#

i had to make a full tutorial on how to do it using Touch portal

sour island
#

oh you still need to use that?

pulsar heath
#

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

sour island
#

I feel like you could make this an API and send it to TIS lol

pulsar heath
#

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

sour island
#

when twitch blew up PZ it was briefly mentioned it was being looked into

pulsar heath
#

like the twitch stats mod i made... i wanted to stream pz but was getting sick and tired of the same questions

sour island
#

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

pulsar heath
#

yeah but touch portal is not very user friendly for some stuff

sour island
#

I'd be curious if I could tie it to non existent keys

pulsar heath
#

you can and you cant

sour island
#

but not having to use touchportal would be nice

pulsar heath
#

i tried that but pz just refuses to work with that key

#

just says unkown key gl something key code

sour island
#

you probably have to register it

pulsar heath
#

yeah most likely

#

but i rather no use keystrokes

sour island
#

fair enough

pulsar heath
#

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

sour island
#

anyway to feed in custom made stuff?

pulsar heath
#

doesnt get easier than that

#

to where? the app?

sour island
#

yeah

pulsar heath
#

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

sour island
#

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 ๐Ÿ˜…

pulsar heath
#

i made it to work with my mod alone, or with yours alone

sour island
#

nice

pulsar heath
#

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

sour island
#

I think cndspeech still has issues in MP

pulsar heath
#

the bit i tested worked fine... added a section on my mod for the twitch events

sour island
#

the issue I mean is that others don't see it?

pulsar heath
#

and hacked a function to get some stuff from your mod

sour island
#

but end-users can be very hard to trust with reports

pulsar heath
#

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

sour island
#

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

pulsar heath
#

yup

#

im only trying to use to have some variety in the says

sour island
#

although hacking another player to see him scream is pretty funny

pulsar heath
#

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

sour island
#

so you make them say random things or?

pulsar heath
#

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"

sour island
#

I did design it as a framework lol

#

makes scaling future features much easier

pulsar heath
#

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

#

๐Ÿ˜„

sour island
#

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

pulsar heath
#

i had the functions running on the keypress event

#

so it was a wall of code

#

messy and unreadable

sour island
#

wasn't expecting to support non-named items in a mod about named literature ๐Ÿ˜…

#

I need to figure out how to sync my zombies

pulsar heath
#
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 ๐Ÿ˜„

red tiger
#

I might do another deep dive on Lua's 5.1 syntax.

pulsar heath
#

this is weird

#

client side nothing happens

#

server side they spawn but dont move :d

#

wth

red tiger
#

I might want to take a stab at interpreting Lua 5.1 as ES5 JavaScript logic.

pulsar heath
#

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

red tiger
#

Am sort of down the path to transpiling Lua as Typescript.. Might as well explore making it fully.

pulsar heath
#

instead of using fixed values

#

never worked with typescript... the 1st thing my brain clicks with typescript is font formatting ๐Ÿ˜„

red tiger
#

Two transpilers on my hands.. This one will be a third one.

sour island
#

Let's have an intervention

red tiger
#

Lua is much like ES5 JS so it's doable.

pulsar heath
#

so where do i post a "feature request"

sour island
#

Forums I suppose - tech support if it can be considered a bug

pulsar heath
#

hmm it is a bug... kinda

sour island
#

I usually dm Nasko with details - but I probably shouldn't ๐Ÿ˜…

pulsar heath
#

ill post in the forum

red tiger
#

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)

sour island
#

I think there's priorities to focus on the roadmap

#

I'm crossing my fingers on the polish update tho

tame mulch
golden sparrow
#

@sour island I run print(getGameSpeed()) on a dedicaced server from files in server/ folder and I get this

sour island
#

but are you using a command?

pulsar heath
#

@tame mulch can i ask you a question?

golden sparrow
#

It is in server/ folder

sour island
#

doesn't matter

golden sparrow
#

It should be run by the server as I'm in mp no ?

red tiger
red tiger
#

I'd have to hardcore mod your machine code. xD

pulsar heath
#

the function createHordeFromTo only works on sp, is there any way to use something similar in mp/host?

fast galleon
#

Will animals fly?

red tiger
#

I just don't see TIS even considering encouraging modding their DLLs.

#

(Security and IP reasons)

pulsar heath
#

to be more precise it works on MP/Host as well but the zombies dont move to the specified XY

sour island
red tiger
#

It'd be fun modifying lighting though...

sour island
#

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

red tiger
#

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.