Auto-translated
Hello everyone. I have a question. I wanted to create a scenario in the map editor: I place a ruined Human Castle and a region in front of it.
The idea is that when this region is activated, the "Unholy Word" spell will be cast on the ruined Castle, and a normal Castle will appear in its place. In my case, it's a Necropolis Castle (I don't know if this detail is important or not).
But when I test it, the spell is cast, the ruined Castle disappears, but the Necropolis Castle doesn't appear in its place...
I've been struggling with this problem for half a day. Maybe someone can help?
Here's the script I'm using: (maybe the problem is in the script? Although about 50% of the script works in the game...)
function Necropolis()
PlayVisualEffect("/Effects/_(Effect)/Spells/UnholyWord.xdb#xpointer(/Effect)", "ruins1", "tag2");
RemoveObject('ruins1');
SetObjectPosition(GORGOR, 23, 16, 1.5);
SetObjectOwner(GORGOR, PLAYER_6);
Trigger(REGION_ENTER_AND_STOP_REGION, "ZAMOK", nil);
end;
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "ZAMOK", "Necropolis");
Edit: I wrote MakeTownMovable("Scripted town name") in the scripts. Now, when the region is entered, the spell plays for about 2 seconds, and the game crashes. What should I do?