Skip to content

Posts from Current questions and answers regarding the map editor.

5.0 (12 ratings)
In reply to Ment
User Avatar
Auto-translated
Ment
I don't know, I tried it myself, but it didn't work. Maybe you could take a look at how the developers did it on the corresponding map?
In THE WORLD OF ENROTH, the lighting often changes. There is lighting in the main.lua file of this map; you can definitely dig around in it.
Моды для HeroesV:
NHF 0.90 : NHF - группа в VK

Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...
In reply to Ment
User Avatar
Auto-translated
Ment
I don't know, I tried it myself, and it didn't work either. Maybe you could take a look at how the developers did it on the corresponding map?
The developers have it written like this:
SetAmbientLight(GROUND, 'c5m5_day',true , 5)
It doesn't work with or without the semicolon at the end.

In the WOE map, it's written like this:
local SET_LIGHT_GROUND = { 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su' }
if mod(GetDate(DAY), 3) == 0 then
local lightIndex = mod(round(GetDate(DAY)/3),7)+1
SetAmbientLight( GROUND, SET_LIGHT_GROUND[lightIndex], nil, 0 )
end

It still doesn't work. It says, "value was nil when getting global with name "round""
"attempt to call a nil value"
In reply to Олегарх
Auto-translated
Good day. Please read the post to the end before asking questions. I apologize for repeatedly bringing up this topic, but I would like to discuss it. I recently started creating a map and decided to place two-sided monoliths in advance. When checking the map, a couple of errors related to the "ground floor" appeared, but the monoliths were standing on level ground, far from the water, and in the middle of the map. When I moved the monoliths a couple of tiles, the error disappeared. What could have caused this error? I also noticed that sometimes this error is a bug, as when saving the map once, the same error appeared, and yet there was absolutely nothing in the specified location – only level ground. When checking the map, this error did not repeat. I certainly don't place objects at the edge of the map, but it seems to me that the protection against errors in the game is too complicated. Please tell me how dangerous these errors are; visually, everything looks fine on the map (or rather, there's almost nothing there anyway).
P.S. I apologize for the number of times I used the word "error" in the post.
P.P.S. Ah, where are those times of the 3rd game... No problems on the map, and you could actually play it normally...
User Avatar
Auto-translated
There are many errors in the editor that do not affect the playability of the map, but are of a "recommendatory" nature. I believe this is one of them. -----
It also doesn't work. It says, value was nil when getting global with name "round"
You have version 3.0 of the game, and this function does not work there. And the array looks suspicious, I think there is a mod in the map to add some types of lighting.
 

К А
Стикеры GBF в Telegram
In reply to Ment
User Avatar
Auto-translated
Ment


You have version 3.0 of the game, and this function doesn't work in that version. Also, the array seems suspicious; I think there's a mod in the map that adds some types of lighting.

I do indeed have version 3.0 of the game. And is there really no way to make SetAmbientLight work?
User Avatar
Auto-translated
My game version is indeed 3.0. And is there really no way to make SetAmbientLight work?
SetAmbientLight should work on any version. Theoretically, at least. But the round function won't.
 

К А
Стикеры GBF в Telegram
In reply to Ment
User Avatar
Auto-translated
Ment
SetAmbientLight should work on any version. Theoretically, at least. But the round function won't.
I tried to add lighting to the map, but it still doesn't work. I took it from one of the packs in the data folder, called underground.
In reply to Олегарх
User Avatar
Auto-translated
Oligarch

local SET_LIGHT_GROUND = { 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su' }
if mod(GetDate(DAY), 3) == 0 then
local lightIndex = mod(round(GetDate(DAY)/3),7)+1
SetAmbientLight( GROUND, SET_LIGHT_GROUND[lightIndex], nil, 0 )
end

doesn't work either. It says, value was nil when getting global with name "round"
attempt to call a nil value
The map uses its own files ;)
'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'
Copy these files to the root of the map and check at least "Tuesday" ;) (and there will be no xdb#xpointer(/AmbientLight) there). You can also easily take the lighting you want from the resources and put it in the map.
"round" is rounding, it probably won't be needed, so don't use it (or better, use 3.1 ;) )
Моды для HeroesV:
NHF 0.90 : NHF - группа в VK

Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...
In reply to Dyrman
User Avatar
Auto-translated
Dyrman
The map uses its own files;)
'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'
Copy these files to the root of the map and check at least "Tuesday" ;) (and there will be no xdb#xpointer(/AmbientLight) there). You can also easily extract the lighting you want from the resources and put it into the map.
"round" is rounding, you probably won't need it, so don't use it (or better, set it to 3.1 ;) )

no, it didn't help. I didn't use "round", I just applied SetAmbientLight to the region
and that's it.
User Avatar
Auto-translated
Olegarch, here's what I found in one of the original missions (3.1):

function SetLight( level, time )
SetAmbientLight( GROUND, "fog_light_level"..level, true, time);
end;

The call is quite simple in one of the functions:

function IsOrnellaMeetArantir()
SetLight(2, 3);
end;

startThread(IsOrnellaMeetArantir);

The script location: Maps/scenario/A2C1M4
Maybe this will help ;)
In reply to KioM
User Avatar
Auto-translated
KioM
Oligarch, here's what I found in one of the original missions (3.1):

function SetLight( level, time )
SetAmbientLight( GROUND, "fog_light_level"..level, true, time);
end;

The call is quite simple in one of the functions:

function IsOrnellaMeetArantir()
SetLight(2, 3);
end;

startThread(IsOrnellaMeetArantir);

The script location: Maps/scenario/A2C1M4
Maybe this will help ;)


But does it need to be applied to one of the regions, for example?
User Avatar
Auto-translated
Thank you. Is it possible to make it rain on the map?
User Avatar
Auto-translated
startThread(IsOrnellaMeetArantir); in this case, the function starts when the game begins. Instead, you can use a trigger and call the same function, for example: `
Trigger(REGION_ENTER_WITHOUT_STOP_TRIGGER, 'youRegion', 'IsOrnellaMeetArantir');
`
In reply to KioM
User Avatar
Auto-translated
KioM
startThread(IsOrnellaMeetArantir); in this case, the function starts when the game begins; instead, you can use a trigger and call the same function, for example:
Trigger(REGION_ENTER_WITHOUT_STOP_TRIGGER, 'youRegion', 'IsOrnellaMeetArantir');

didn't help :mad:. but I'm interested in "fog_light_level"...level, true, time
doesn't it require specifying the path to the lighting, and where does "level" come from?

Statistics