Jump to content

Morry

Member
  • Posts

    38
  • Joined

  • Last visited

Recent Profile Visitors

1518 profile views

Morry's Achievements

  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.
×
×
  • Create New...