ID:1260534
 
I have played a lot of Avernum lately, and in avernum 3 there is a point where if you don't destroy the slime infestation in the area the city crumbles over time and if the player doesn't solve the issue in a period of time the city falls apart.

Avernum has always amazed me with the vastness and realistic nature of the game and I would love to dissect how its done and replicate it for learning purposes :)

I was impressed with the idea of the game world changing over time based on player actions or lack there of.

So my question is, How would I go about making, say, city walls that are deleted over time or a mob that dies in a city somewhere due to time etc.

I tried somethings but I guess I don't have a valid understanding of how to relate world time with what happens to the player.

I know this would be possible as I have seen whether systems that change the world over time.

Would I be able to give the mobs a certain var after so many ticks and then use a proc to check if that mob has that var and then delete the mob?

example: A wall has a destroyed var if 1 its deleted if 0 it isn't and after so many clicks the world assigns the var destroyed = 1 to the wall then runs a proc to check that var and then deletes it, even if the player isn't in the area.

I guess I just need a place to start lol :)

It seems a tad daunting, I guess If I knew where to start, perhaps something simple that does this and then work from their.

This is mostly for curiosity to see if this is possible with Byond.

Any help or ideas are appreciated I am curious to see how this could be accomplished. :)

Thanks in advance!
Bloodocean7.



All objects can run procs themselves - you don't need to rely on a mob to initiate things. That's the beauty of programming.

How about you go more than just a simple boolean value for wall destruction? Give walls a sort of "health", or "integrity". Have it degrade over time (Loops), and speed up the degradation when things put stress on it, like being blown up.

Artificial intelligence is what you are going for here. AI isn't limited to just "enemy mobs", you can give anything the artificial intelligence it needs to do things "on their own".
I'm not too sure on the concept, but why do you need to set a var to destroy something? If you want something destroyed, just do it. No players need to be anywhere near it.
Ah I see what you mean, So instead of having the world add variables, have the walls them selfs slowly degrade over time. perhaps I could figure out a way to stop this degrading process when the player completes a quest.

however I always seem to have a problem figuring out how to add procs to mobs so they are always running, rather than when a verb is used.

but I feel your on to something there :)

Thanks for the quick reply, I feel I'm getting somewhere already lol :)

Bloodocean7
In response to Bloodocean7
Bloodocean7 wrote:
however I always seem to have a problem figuring out how to add procs to mobs so they are always running, rather than when a verb is used.

You need to look up what loops are and how to use them.

Also...your name is right there to the left of your message. No need to sign your post.
in reply to kaiochao,

well I'm trying to make it so that if a player has not completed a quest the city walls fall into ruins and when they complete the quest the city is saved and the walls no longer crumble and citizens no longer die.

or something to that effect.

I know I could just delete the walls but I'd like a way for the game to check if the player has completed the quest within a period of time and if not a section of the wall is deleted and this continues until the city is destroyed or the player completes the quest.

In response to Albro1
I guess I do lol It sounds like that would be the way to accomplish this.

also sorry about that, its a habit lol :)
Do you know of any good resources to learn about loops and this general thing? I have been searching but still haven't found a good tutorial on it.

Thanks!
Looping isn't that hard. A loop just executes a section of code over and over again until certain parameters are met.