|
|
Kronos1000
Promising
Supreme Hero
Fryslân Boppe
|
posted November 21, 2006 09:40 PM |
|
|
Scripting prob
Please let me know what's wrong with this script:
Quote: function Day2()
if GetDate(DAY) == 2 then
MessageBox("Maps/SingleMissions/The Return Of Sandro/Day2.txt")
end
Trigger(NEW_DAY_TRIGGER, Day2());
The path is right, but when I use it all of my other scripts crash!
Please tell me what's wrong?
|
|
meows
Tavern Dweller
|
posted November 22, 2006 10:30 AM |
|
|
Quote: Please let me know what's wrong with this script:
Quote: function Day2()
if GetDate(DAY) == 2 then
MessageBox("Maps/SingleMissions/The Return Of Sandro/Day2.txt")
end
Trigger(NEW_DAY_TRIGGER, Day2());
The path is right, but when I use it all of my other scripts crash!
Please tell me what's wrong?
function NewDayTrigger()
if GetDate(DAY) == 3 then
SetRegionBlocked("blockgodric", false, PLAYER_3);
SetRegionBlocked("blockOrson", false, PLAYER_1);
MessageBox("Maps/SingleMissions/a test2/firs.txt");
end;
if GetDate(DAY) == 3 then
AddHeroCreatures("Straker", 38, 5);
end;
end;
Trigger(NEW_DAY_TRIGGER, "NewDayTrigger");
above is a working example.. for yours try
function Day2()
if GetDate(DAY) == 2 then
MessageBox("Maps/SingleMissions/The Return Of Sandro/Day2.txt")
end
Trigger(NEW_DAY_TRIGGER, "Day2");
____________
|
|
Kronos1000
Promising
Supreme Hero
Fryslân Boppe
|
posted November 24, 2006 04:18 PM |
|
|
It does not work either this is my complete script:
Quote: Edit: Script removed
Mabey someone can see what's wrong with is.
Edit: Solved the problem
|
|
Kronos1000
Promising
Supreme Hero
Fryslân Boppe
|
posted November 30, 2006 07:44 PM |
|
|
No it didn't work because I only used one end instead of 2 lol
My map is almost finished now, it's a single player map about Sandro with working scripts of course Pics coming soon.
|
|
Kronos1000
Promising
Supreme Hero
Fryslân Boppe
|
posted December 02, 2006 09:44 AM |
|
|
I have a new problem now what's wrong with this:
Quote: function Inferno_1(PLAYER_8, PLAYER_3, heroname, townname)
MessageBox("Maps/SingleMissions/The Return Of Sandro/Capt_INF.txt");
SetObjectiveState("KillAgrael", "OBJECTIVE_ACTIVE", "playerID = PLAYER_3");
Trigger(OBJECT_CAPTURE_TRIGGER, "Inf_1", nil);
end;
Trigger(OBJECT_CAPTURE_TRIGGER, "Inf_1", "Inferno_1");
and this:
Quote: function KillCyrus(Tan)
LevelUpHero("Aberrar");
MessageBox("Maps/SingleMissions/The Return Of Sandro/Death.txt")
Trigger(PLAYER_REMOVE_HERO_TRIGGER, "PLAYER_5", nil);
end;
Trigger(PLAYER_REMOVE_HERO_TRIGGER, "PLAYER_5", "KillCyrus");
Another example:
Quote: function KillAgrael(Agrael)
LevelUpHero("Aberrar");
MessageBox("Maps/SingleMissions/The Return Of Sandro/Inferno.txt")
Trigger(PLAYER_REMOVE_HERO_TRIGGER, "PLAYER_8", nil);
end;
Trigger(PLAYER_REMOVE_HERO_TRIGGER, "PLAYER_8", "KillAgrael");
EDIT: The terrain of the map is finished but this 3 scripts don't work, when they work I'll release the map.
|
|
sfidanza
Promising
Supreme Hero
|
posted December 03, 2006 11:52 PM |
|
|
There are some obvious mistakes in your scripts, like using constants for variables and such. I'll just give you some quick notes here as I don't have much time.
Let's take your third function (KillAgrael). The second one (KillCyrus) would work the same way.
First, when you associate the trigger to you handler, PLAYER_8 is the actual integer constant, not a string:
----------------
Trigger(PLAYER_REMOVE_HERO_TRIGGER, PLAYER_8, "KillAgrael");
----------------
Then, your function should have two arguments, as explained in Nival's script functions reference pdf:
- the name of the lost hero (for example: heroname)
- the name of the hero that killed him - nil if fired (killername)
So what you want to do is this:
----------------
function KillAgrael(heroname, killername)
if heroname == "Agrael" then
LevelUpHero("Aberrar");
MessageBox("Maps/SingleMissions/The Return Of Sandro/Inferno.txt")
Trigger(PLAYER_REMOVE_HERO_TRIGGER, PLAYER_8, nil);
end;
end;
----------------
And you can even check who killed Agrael if you wish.
With the same principles in mind, your example 1 should be like:
----------------
function Inferno_1(oldowner, newowner, heroname, townname)
if oldowner == PLAYER_8 and newowner == PLAYER_3 then
MessageBox("Maps/SingleMissions/The Return Of Sandro/Capt_INF.txt");
SetObjectiveState("KillAgrael", OBJECTIVE_ACTIVE, PLAYER_3);
Trigger(OBJECT_CAPTURE_TRIGGER, "Inf_1", nil);
end;
end;
Trigger(OBJECT_CAPTURE_TRIGGER, "Inf_1", "Inferno_1");
----------------
Note the changes in SetObjectiveState().
|
|
Kronos1000
Promising
Supreme Hero
Fryslân Boppe
|
posted December 04, 2006 03:55 PM |
|
|
Thank you! I'll try to get it to work and if it works I'll realease my map today
EDIT: My map is finished and I couldn't find any bugs here it is: The Return of Sandro.zip
|
|
|
|