How to prevent deletion of some buildings like wonders

Modding, Map Editor, IES Scripting and Other Questions
Post Reply
PaulStretch
Posts: 112
Joined: 27 Jun 2021, 16:10
Has thanked: 45 times
Been thanked: 13 times

How to prevent deletion of some buildings like wonders

Post by PaulStretch »

I'm curious if it's possible to mod the game so some other buildings, like wonders for example, can't be deleted only destroyed.

User avatar
Dr.MonaLisa
High Representative
Posts: 8697
Joined: 17 Jun 2010, 11:21
Location: Poland
Has thanked: 49 times
Been thanked: 108 times

Re: How to prevent deletion of some buildings like wonders

Post by Dr.MonaLisa »

I would use the Area Effect (which by the way already exists, no need to add):

Code: Select all

DbAreaEffectInfo PreventDeletion
{
	effects = [
		EffectPreventDeletion {
		range = Unit
		player = Self
		}
	]
}

DDF:

Code: Select all

UnitType MyWonder
{
	abilities = [
	    LOS { range = 13 }
            AreaEffect {
			effects = [ 
				PreventDeletion
			]
		}
            
	]
	
}
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
These users thanked the author Dr.MonaLisa for the post:
PaulStretch
PaulStretch
Posts: 112
Joined: 27 Jun 2021, 16:10
Has thanked: 45 times
Been thanked: 13 times

Re: How to prevent deletion of some buildings like wonders

Post by PaulStretch »

thanks

Added after 15 minutes 13 seconds:
Not being able to delete roads is hardcoded? That area effect isn't being used by roads. or is it that the unit itself isn't owned by any player?
User avatar
Dr.MonaLisa
High Representative
Posts: 8697
Joined: 17 Jun 2010, 11:21
Location: Poland
Has thanked: 49 times
Been thanked: 108 times

Re: How to prevent deletion of some buildings like wonders

Post by Dr.MonaLisa »

I'm not sure, but I think the second thing. Roads have probably "Owner" parameter in DDF, so players don't get distracted attacking them piece by piece while invading.
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
Post Reply

Return to “Questions”