Skip to content

Scripts for beginners.

User Avatar
#91
Auto-translated
Ment
I didn't understand how it worked for you back then... Are you sure you were playing as the second player? ) If you were playing as the first player, nothing would happen to your quests, because the script specifies that the state changes only for the second player.

It was such an ugly workaround to make the player blue. That's why I started the game as the second player :) But I figured out the color issue - I checked your FAQ :)
Jack_of_shadows
It seems like the `proph_event` function is missing an `end` for the `if/else` statement.
We can try that. After Python, it's hard to get used to the idea that `end` statements are needed everywhere :)

Update: Thanks, Jack_of_shadows, there was indeed a missing `end` there. But now another problem arises: the quest doesn't want to complete.
path = GetMapDataPath()
function activate(obj)
SetObjectiveState(obj,OBJECTIVE_ACTIVE,PLAYER_1)
end

function complete(obj)
SetObjectiveState(obj,OBJECTIVE_COMPLETED,PLAYER_1)
MessageBox(path.."text1.txt")
end

function proph_event(hero)
if GetObjectiveState("Conquer") == OBJECTIVE_UNKNOWN then
activate("Conquer")
else
if (GetObjectiveState("Conquer") == OBJECTIVE_ACTIVE and HasArtefact(hero, ARTIFACT_ENDLESS_BAG_OF_GOLD)) then
complete("Conquer")
Trigger(OBJECT_TOUCH_TRIGGER, "Prophet", nil)
end
end
end

SetObjectEnabled("Prophet", nil)
Trigger(OBJECT_TOUCH_TRIGGER, "Prophet", "proph_event")

I tried commenting out the part that checks if the hero has the artifact, and it worked fine :)

It seems like there's a problem with
and HasArtefact(hero, ARTIFACT_ENDLESS_BAG_OF_GOLD))
Any ideas? :)
Злой пещерный демон:smile24: