Skip to content

Posts from Scripts

4.8 (8 ratings)
In reply to 32MeTpa
8 years ago
Auto-translated
I doubt it, but it’s worth a try.
User Avatar
8 years ago
Auto-translated
Godric's Hollow; it needs to be placed after each completed line)
and essentially, you can add print(""); to the function to make sure it's actually being called by the script.
User Avatar
8 years ago
Auto-translated
; you need to put it after each completed line)
Not required.
In reply to Jack_of_shadows
User Avatar
8 years ago
Auto-translated
Jack_of_shadows
KioM, I suspect that all these transfers of static objects in the fifth game were implemented rather carelessly. For example, I had a case where a campfire within one level could be moved normally, but if I tried to move it from the underground to the surface, strange bugs started to occur. Considering that the bridge affects the surface geometry, Nival might not have implemented the change in geometry when transferring it and creating it using CreateStatic(). Perhaps, even when the bridge is moved, there is still a possibility to walk through the place where it was originally?

Maybe there is a way to make the hero pass through the created bridge using a script? To force it, so to speak.
User Avatar
8 years ago
Auto-translated
Well, maybe with some workarounds. Like, take a static object, a hero for example, and play an animation...
The heroes themselves seem to be automatically positioned according to their z-coordinate, so they might end up intersecting with the background. If it even works at all.
User Avatar
8 years ago
Auto-translated
If the bridge is impassable, the game should still prevent the player from simply sending their unit to the other side; it should be considered inaccessible. You would have to force the player to approach the bridge and somehow initiate the crossing (e.g., using a teleport function with no animation, so it instantly teleports – a common game convention). Alternatively, you could create a shallow river with a ford in that location, place a region there, and block it for the player, then unlock it after the bridge is built.
In reply to Jack_of_shadows
8 years ago
Auto-translated
How do I make cells inactive so that units cannot move onto them? In my case, these are various types of walls.
User Avatar
8 years ago
Auto-translated
What is the correct way to write the command that changes the type of a creature recruitment building on the map (the ones that increase growth)? I need to change all 4 Dwarf buildings, including the outpost, to equivalent Necropolis buildings.
In reply to AstralLein
User Avatar
8 years ago
Auto-translated
AstralLein
I have a question: what is the correct command to change the type of a building that recruits creatures on the map (the ones that increase recruitment)? I need to change all 4 Dwarf buildings, including the outpost, to the corresponding Necropolis buildings.
ReplaceDwelling('name', TOWN_NECROMANCY)
User Avatar
8 years ago
Auto-translated
It doesn't work.

Added 1 minute later
There's no script error, and no effect. The script continues to run normally, but the buildings don't change.
User Avatar
8 years ago
Auto-translated
What is the entire script like?
User Avatar
8 years ago
Auto-translated
Just a moment...

Added 4 minutes later
Trigger(OBJECT_CAPTURE_TRIGGER, "PlayerTown", "CaptureStraker")

function CaptureStraker()
if ( GetObjectOwner ("PlayerTown") == PLAYER_4 ) then
Trigger(OBJECT_CAPTURE_TRIGGER, "PlayerTown", nil)
sleep(5)
TransformTown("PlayerTown", TOWN_NECROMANCY)
ChangeHeroStat("Straker", 7, -999999999999999)
sleep(5)
SetAIPlayerAttractor("PlayerTown", 4, 1)
ReplaceDwelling("Dwell1", TOWN_NECROMANCY)
SetObjectOwner("Dwell1", 4)
ReplaceDwelling("Dwell2", TOWN_NECROMANCY)
SetObjectOwner("Dwell2", 4)
ReplaceDwelling("Dwell3", TOWN_NECROMANCY)
SetObjectOwner("Dwell3", 4)
ReplaceDwelling("Dwell4", TOWN_NECROMANCY)
SetObjectOwner("Dwell4", 4)
end
end

Added 1 minute later
ChangeHeroStat("Straker", 7, -999999999999999) was intended to remove all movement points and prevent the hero from committing suicide during the castle transformation, but he still manages to enter it and die.
User Avatar
8 years ago
Auto-translated
Place commands like print(1), print(2), ... between the key commands so you can see exactly what is not being executed.
User Avatar
8 years ago
Auto-translated
I did just that. Everything is executed, but the building type remains the same.
User Avatar
8 years ago
Auto-translated
That’s strange, I just checked it on the Blade Keep on the “School” map, and it worked.

Statistics

Welcome our newest member: recijeb