Connection ErrorBad RequestThis page went staleSession ExpiredSign in requiredForbiddenNot FoundToo Many RequestsServer ErrorBad GatewayService UnavailableGateway TimeoutHTTP Version Not Supported
Session Expired
Your session has expired. Please log in to continue.
Sign in required
You need an account to do that. Sign in or create one — it only takes a minute.
This page went stale
Your security token was rejected, usually because the page sat open too long or you signed in elsewhere. Nothing was saved. Reload the page and try again.
Request Failed
We encountered an issue while processing your request.
Please check your internet connection and try again.
See the manual for functions. Trigger(OBJECT_TOUCH_TRIGGER,....) – this is for touching a monster. SetObjectEnabled("script name of the object (monster)", nil) – this is to prevent the monster from attacking. QuestionBox Also, check the FAQ in the section here. There is a slightly different example, but it is easy to adapt it.
Please help:smile45:. I wrote what seemed like a simple script, but it doesn't work as expected. The idea is simple: if there are creatures in the region, the script does nothing. But if they are killed, the script generates new ones, and this calculation happens every 2 days of the week.
function new_day() local day = GetDate(DAY_OF_WEEK) if day == 2 and IsObjectInRegion('kan','kopt') elseif day == 2 then CreateMonster( 'kan', 49, 5,81, 122, 0, MONSTER_MOOD_WILD, MONSTER_COURAGE_CAN_FLEE_JOIN, 0)
function new_day()
local day = GetDate(DAY_OF_WEEK)
if day == 2 and IsObjectInRegion('kan','kopt') then
CreateMonster( 'kan', 91, 5,81, 122, 0, MONSTER_MOOD_WILD, MONSTER_COURAGE_CAN_FLEE_JOIN, 0)--creates a phoenix
elseif day==2 then
CreateMonster( 'kcn', 49, 5,81, 122, 0, MONSTER_MOOD_WILD, MONSTER_COURAGE_CAN_FLEE_JOIN, 0)-- creates druids
end
end
Trigger(NEW_DAY_TRIGGER,'new_day')
However, in the end, neither druids nor phoenixes appear, although, according to the logic, only druids should be created.
So, I need a complex script; I tried to do it myself, but it didn't work. The script should do the following: if a Necropolis castle is captured, you can stand on a tile next to the castle, and a choice will appear: destroy the castle for 30 wood, 30 ore, 10 of each rare resource, and 10,000 gold. If you click "no," nothing happens. If you click "yes," the resources are deducted, the Necropolis castle disappears with a "Holy Word" animation, and a ruined Human castle appears. Next, if you stand on the same tile again, the same choice is offered: build a Human castle for 50 wood and ore and 15 of each rare resource and 20,000 gold. If you click "yes," the ruined castle disappears with the same "Holy Word" animation, and a regular level 1 castle appears. If you don't have enough resources, the action fails, and the ruined castle remains. How can this be implemented?
Added 1 minute ago
I'll mark the tile with a region and put a circle on it so it's visible.
Well, that's about the editor, but I was asking about the console. The game does have something that displays text (you need to activate the console to see it. It seems to be mentioned in the FAQ).
It says that an object with the name "kan" does not exist. That makes sense. You need an IsObjectExists check (or something similar). It seems that the IsObjectInRegion function doesn't check for these things; it immediately tries to find the object's coordinates, but it doesn't exist...
Well, something similar was in the scenario "Unity of the Elements," but there, about half of my script was copied from his script, I made a few corrections, but it doesn't work.
Godric's Hollow, well, if you post both your script and the source code, that would be great. Make it easier to help, so we don't have to start from scratch, but can just offer suggestions.