Jump to content

Morry

Member
  • Posts

    38
  • Joined

  • Last visited

Everything posted by Morry

  1. Calling the 'new' method seems to only work in debug mode now...
  2. http://steamcommunity.com/sharedfiles/filedetails/?id=1152751225 I made something that makes this suggestion possible and a few more things, by making you able to change most sandbox variables over time. It's not the most user friendly thing in the world, but this way you can also do cool things such as increasing the size of zombie groups over time. This is something I wanted to be in the game for a long time, I hope this also fulfills your suggestion in a way.
  3. Try something like this while having the item in your inventory. local check = inv:contains("iGod.iGod_DivineSpark") print (check) This prints the value to the console, so if you do it in the update it's going to be printed a lot. Or you could check the value of the local variable in debug mode.
  4. I think you're missing the "end" of function iGod_Immortal(). The only "end" in this code snippet is of the elseif. In that case the Events.OnPlayerUpdate.Add does not work.
  5. OnAIStateChange is not called in one of the changeState functions. Also please make it trigger after the state change happens so it's possible to revert state changes. And on the subject of StateMachine.class, it is not exposed to the LuaManager. Please expose the StateMachine.class.
  6. Never until they are suddenly released. I don't need complex npcs, as long as they can do most of what a player can such as following recipes, applying first aid on themselves. As long as they are programmed in a sensible way, are sort of abstracted and somewhat easily extendable.
  7. @Ragno When they reach the a low density they won't always immediately stop. For each zombie there is a unique timer, when that timer triggers and a random value between 0&1 is larger than 0.5 then the zombie check if it needs to change it's flocking behavior. So they probably will stop but it might take a bit longer because of the randomness. Meta events should still work, because certain behavior is hard coded in the update function of zombies. Urban / uniform should still work, I don't see a reason why it should not. Only thing that does not work currently is thumping against objects while flocking/wandering, because the function responsible for that has some hard coded silly state checks in it Zombies only flock when they are 'real' zombies, which means they're in the same cell as you. I can't adjust 'virtual' zombie behavior as far as I know. So they should not be able to flock too far away from you.
  8. Uploaded a version of the mod. It should be able to handle 100 +/- concurrently flocking zombies, I also added a wander behavior. Please try it out if you have the time.
  9. @jinoz First because I could not access the target of zombies. But I have found a way to do that, but it still does not work for some reason. I don't know why but it just does the normal lunge behavior while in multiplayer.
  10. Well I updated it with getClassFieldVal, so the zombie target is known. But it still does not work in multiplayer. Do zombies in multiplayer use different code than in single-player or something like that?
  11. @sthalik Maybe nobody just knows about this function or the devs have forgotten that it exists, I've at least never seen anyone talk about it on the forum. But I found a much easier solution for accessing fields. This method in LuaManager gets the value of a specified field. There are also methods to access the number of fields and getting a field from an object. I will update the mod to use this soon... @LuaMethod(name="getClassFieldVal", global=true) public static Object getClassFieldVal(Object o, Field field) { try { return field.get(o); } catch (Exception ex) {} return "<private>"; }
  12. Hello, I'm working on a mod that modifies zombie behavior. I currently change the state of zombies into the LuaState, a state which enables you to control characters through lua, in the hopes that they would not do anything on their own. However there is a lot of hard coded stuff in the Update function of IsoZombie that still triggers a state change. My idea to prevent this was to use the OnAIStateChange event to revert a state change immediately when it happens. But this does not work because of two problems that I am running into. First of all, the actual state change is done after the event trigger, so the state change will happen regardless. this.CurrentState = newState; comes after LuaEventManager.triggerEvent("OnAIStateChange", this.Owner, newState, this.CurrentState); Secondly, OnAIStateChange is only called for one of the two changeState() functions. Which is the one with two arguments and as far as I can tell that one is not used anywhere. Does anyone have an idea on how to achieve state change prevention? Or could a developer please change this (seemingly) unused event to happen after the state change so reverting the state is possible. And add the trigger to the single parameter changeState() as well. The relevant code, with the missing event call:
  13. Do you mean the rally group? That uses leaders that other zombies gather around right? As far as I can tell the current system in zomboid does not take other zombies into account while walking around, if it does please show me where. In the video I turned off the grouping behavior from the advanced zombie settings. Boids does not use leaders, just local behavior with neighboring boids.
  14. Hello, I am currently working on a mod which aims to put the 'boid' in zomboid, to make zombies act more like herd animals by implementing boid behavior. Boids is an artificial life program that simulates the flocking behavior of birds. There's now a version available to try it if you want to. This is very much a work in progress, the mod can currently handle around 100 concurrent flocking zombies. Put the zombie rally group size on 0 or else zombies will probably start flocking all the time. How it currently works / What is implemented: Only basic separation, cohesion and alignment at this moment. Whether a zombie starts to flocks depends on: the density of zombies in its local area, a random value which becomes less significant the higher the zombie density A timer that that triggers every few real seconds, every zombie has its own timer A zombie stops flocking when the zombie density in its area decreases to a certain value. A grid that ensures that for each zombie only nearby zombies are checked. Every ten in-game minutes there is a chance a zombie will start wandering around through steering behavior. Anticipation / interception of player during lunge state. Issues / To be fixed / To be added: During flocking & wandering zombies will not start thumping on things they walk against. Improve the wandering Probably a lot more that I forgot right now. Video of current work: I based the zombie density thing on locust that start marching in the same direction when reaching a certain density, if it works that way for simple creatures such as locust than it probably should work that way for zombies too. Link More on boids flocking zombies.zip
  15. You are using the update function, so this is being called 30/60 times each second. You might want to put it on EveryTenMinutes instead and do these actions for each player there.
  16. @sthalik I would say try to make that static initializer thing work. I'm not sure how to do that myself, but it sounds like you do.
  17. @sthalik I did not really look that much other states for intercepting because I wanted to my first attempt simple. As long as you have an IsoMovingTarget target you'll be able to access the targets velocity, which you need for any intercepting. So I think it would be possible, but it might look silly if slow zombies try to intercept you from far away. I have no idea how feasible it is to hook the class loader, being able to add methods would be great but with no workshop you might as well just make a java mod. And I am going to look into what you sent here
  18. I did not think it was possible at first but I rewrote the mod in Lua so java files do not have to be manually replaced anymore. But now I have the problem that I can not access IsoZombie.target, probably because it is a variable instead of a function. I need to be able to access the zombie target in order to get the mod working with multiplayer. This could happen if getTarget() and setTarget() which get and set IsoZombie.target were added to IsoZombie. What would be the correct place to request such a thing?
  19. Hello. This mod edits the lunge behavior of zombies, which is the part where most of them stretch out their arms and run towards you. Instead of heading directly towards the player, zombies now try to predict a player's future position to intercept them instead of constantly lagging behind them. Please try it out and tell me what you think of it. Now redone in Lua! Currently singleplayer only, I can not access IsoZombie.target through Lua for some reason, so currently the first player is always used instead. Steam Workshop version update 1: Fixed TargetVelocity. Lunging zombies only anticipate when then are near you, should prevent slow shamblers from attempting to out manouver you while being 10 meters away... While trying to run past zombies, the zombies should move more towards you instead of only cutting off your route Known issues: Singleplayer only. anticipating zombies.zip
  20. 162. Some kind of mouse walk or a shortcut for "walk here", for walking long distances with sped up time.
  21. Will we be able to hit zombies through the fences without damaging the fences themselves?
  22. What about, depending on your medical skill, that you can diagnose others (and yourself) for deficiencies in diet? But only when the deficiency becomes large enough to cause symptoms. So you'd be able to identify the type of deficiency but that's all.
  23. Now that it is possible to pick up furniture, would it not be nice if we could saw/dismantle wooden furniture into planks? It would be a good alternative to chopping doors when you need a few planks quickly.
  24. What about depending on how much hp the object has (how solid it is) and if no other near zombies are thumping near it . the zombie gives up on getting through / forgets what it's doing and goes idle? So when a wall is in the way, a single zombie doesn't always keeps thumping till it is down, it might make several attempts on getting through, but not a continuous one. I mean, a weak structure or something falling apart would probably probably budge or something when thumping it, giving feedback to the zombie... A sound structure wouldn't. No feedback would probably make a zombie forget what he's doing, making it go idle. Which can result in 3 things: It stays in front of the place structure it was thumping, it starts walks in the direction of the structure and begins thumping again or it walks in a different direction and best case scenario walks out of sight. For example: A single zombie would still break an unbarricaded window but might give up on a door after a few hours.
×
×
  • Create New...