| function in script for map | |
|
Draglio

 
Tavern Dweller
|
posted November 09, 2025 09:30 PM |
|
|
function in script for map
Hello!
I am editing a map on Homm5 ToE.
In the script editor (in Map properties menu), I put the script but the Check button displays the following warning:
Function myfunction not defined, line 1
even with the example of the HOMM5_Editor_Practical_Guide.pdf (function Meeting( heroname )) gives this warning...
what is wrong?
my script is:
Function Region3 (player)
if player==PLAYER_3 then
p3a=GetObjectOwner(Portail3)
if p3a=PLAYER_NONE then
SetObjectOwner(Portail3,PLAYER_3)
end
Trigger(REGION_ENTER_WITHOUT_STOP_TRIGGER, "Ground3", nil)
end
end
Trigger(REGION_ENTER_WITHOUT_STOP_TRIGGER,"Ground3","Region3")
____________
|
|
bknight2602

 

Hired Hero
|
posted March 18, 2026 09:01 PM |
|
|
Draglio said: Hello!
I am editing a map on Homm5 ToE.
In the script editor (in Map properties menu), I put the script but the Check button displays the following warning:
Function myfunction not defined, line 1
even with the example of the HOMM5_Editor_Practical_Guide.pdf (function Meeting( heroname )) gives this warning...
what is wrong?
my script is:
Function Region3 (player)
if player==PLAYER_3 then
p3a=GetObjectOwner(Portail3)
if p3a=PLAYER_NONE then
SetObjectOwner(Portail3,PLAYER_3)
end
Trigger(REGION_ENTER_WITHOUT_STOP_TRIGGER, "Ground3", nil)
end
end
Trigger(REGION_ENTER_WITHOUT_STOP_TRIGGER,"Ground3","Region3")
I'm by no means an expert at LUA, but a question I have
player may be or not be PLAYER_3, that player may be in the group PLAYER_3 or all of it so PLAYER_3 is not defined
I use playername=GetPlayerHeroes(PLAYER_3). I hope this helps
then the player who I assume touches the object then see if the player is in the group, PLAYER_3 a number of routines can decide this remember the group is zero based.
|
| |
|
|