-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Permanently enable mountain signs #6
Comments
Interesting idea. I pushed a commit on branch dev-mapaccess that should allow you to do this. I haven't tested any features of that branch so its likely that it needs some fixes / polishing. Here is how i would do it:
Signs spawned this way should never despawn since the MapAddDecoObject should not register a removal event to the event engine. Also I do not know the id of the signs that are needed for the MapAddDecoObject function yet. |
Probably some problem with the precompiled code. I will push the missing code. That already caused problems in the past.
It may be possible that it does not work. But that is not intended. I may have a look at it later. I hope it gets fixed when building without the precompiled code that i just pushed.
You could try LandscapeGetObject which should return the entity id of the object at a specific position. If there is no object it should return 0. Pass the entity id to EntityDecoGetType to get the deco type of the deco object (eg. it would be 199 for gold3 sign) However i think the game optimizes the signs a little. There seems to only exist one entity for all signs of the same type. I am not sure if the game actually writes the signs entity id to the map that LandscapeGetObject accesses. But its worth a try. If you cannot fix the crash it may be worth looking into how the game spawns the signs. The method that lets a geologist spawn a sign is at S4_Main.exe + 0x17b1b0. It is a method of the CGeologistRole class that takes a single argument (that probably is a pointer to the geologist entity). The spawning of the sign (in that method) happens probably at S4_Main.exe + 0x17b2ba and/or S4_Main.exe + 0x17b2c8. The first 3 arguments of both these functions is x, y, and the deco id (eg. 199 for gold3). The other arguments are constants. |
Without diving too deep into your project I wanted to know if it is possible to always show the mountain signs from the beginning of the game and never have them decay, thus rendering the geologist obsolete.
If it is possible could you outline the steps necessary to achieve this effect? I would gladly implement them myself!
Randomly searching on the mountains slows the game down and I could enjoy the game more if I don't need to do that. I intend to use it in single player only.
The text was updated successfully, but these errors were encountered: