Skip to content
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

[LUA] Allow AddStaticObject to replace anything #1692

Open
kubaau opened this issue Jul 28, 2024 · 3 comments
Open

[LUA] Allow AddStaticObject to replace anything #1692

kubaau opened this issue Jul 28, 2024 · 3 comments

Comments

@kubaau
Copy link
Contributor

kubaau commented Jul 28, 2024

S2 RTX event !MET_SET_MAP_ELEMENT was almost always used to activate gates (replace existing gate with activated one), but there is at least one interesting case where it was used to destroy buildings. In 2NDpaign chapter 3 occupying a certain position used !MET_SET_MAP_ELEMENT to place a rock where the player's HQ (and harbor) were (effectively cutting them off forever). This essentially destroyed these buildings (although there was no fire, no one left and borders were not recalculated):

S2:
Zrzut ekranu 2024-07-29 001013
Zrzut ekranu 2024-07-29 001036

A similar effect can be achieved in RttR by modifying LUA's AddStaticObject to replace whatever is there with no regard:
Zrzut ekranu 2024-07-29 002102

@Spikeone
Copy link
Member

This should be an extra parameter and should probably destroy any resulting invalid objects (e.g. in this case the road segment and border).

@Flamefire
Copy link
Member

This would still modify the border when a recalculation happens as the building holding the border doesn't exist any more and I don't see how to easily change that. So what exactly should this do and why?

@kubaau
Copy link
Contributor Author

kubaau commented Jul 29, 2024

I don't think this should necessarily mirror the S2 implementation because these last pictures are rather confusing. In S2 it is not even obvious what happened because you don't get folk running around as if an HQ/harbor was destroyed, just a silent rock is placed with a road and a flag sticking out of it :D The intention of this ticket is to have the option to replace any object. What follows is up for discussion :)

To get the strangle-looking implementation above I commented out a DestroyNO call in LuaWorld::AddStaticObject but leaving it in results in a more sane result:
Zrzut ekranu 2024-07-29 123432

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants