I can't get a message to display
I can't get a message to display
Like I said in the other thread, I'm a noob map maker, and am trying to script a message. I created the text box and everything, but it didn't actually make a text file of that message on my hard drive; should it have? I'm pretty sure I have the coding right, I'll copy it here. Sorry I'm such a noob, I'll probably have a lot of questions ;-)
function Prologue()
if GetDate(DAY)== 1 then
MessageBox("Maps/SingleMissions/asdf/Prologue.txt")
end;
end;
Trigger(NEW_DAY_TRIGGER, "Prologue");
EDIT: I found the file on the hard drive actually, I was looking under the wrong Maps folder.
function Prologue()
if GetDate(DAY)== 1 then
MessageBox("Maps/SingleMissions/asdf/Prologue.txt")
end;
end;
Trigger(NEW_DAY_TRIGGER, "Prologue");
EDIT: I found the file on the hard drive actually, I was looking under the wrong Maps folder.
- Grumpy Old Wizard
- Round Table Knight
- Posts: 2205
- Joined: 06 Jan 2006
- Location: Tower Grump
Re: I can't get a message to display
Don't put any script that you want executed on the first day inside the New Day trigger function. It must come before the function.John.Galt wrote:Like I said in the other thread, I'm a noob map maker, and am trying to script a message. I created the text box and everything, but it didn't actually make a text file of that message on my hard drive; should it have? I'm pretty sure I have the coding right, I'll copy it here. Sorry I'm such a noob, I'll probably have a lot of questions ;-)
function Prologue()
if GetDate(DAY)== 1 then
MessageBox("Maps/SingleMissions/asdf/Prologue.txt")
end;
end;
Trigger(NEW_DAY_TRIGGER, "Prologue");
Edit 1: Oh, I didn't read carefully enough for the first part of your question. You have to create the text file under map properties tree.
Look on the bar at the top of the editor for "view." Click it then click "Map Properties Tree." Click on the "+" sign in front of "Resources" then click on "Save Filenames" in order to highlight it. Right click on Save Filenames and chose "Add"
Now click on the + sign in front of Save Filenames. Click on the + in front of "0", here is where you create the file.
Click on SaveFileNameFileRef to highlight it. Now click out to the right of it. You will see a field opened up.
Click on "New", type in the file name, click "OK", and type in your message, click ok again and save your map.
GOW
Frodo: "I wish the ring had never come to me. I wish none of this had happened."
Gandalf: "So do all who live to see such times but that is not for them to decide. All we have to decide is what to do with the time that is given to us."
Gandalf: "So do all who live to see such times but that is not for them to decide. All we have to decide is what to do with the time that is given to us."
Yeah, I had already created the text file, but I thought it was under the Maps folder in the main Heroes directory, so I couldn't find it, but it was in another one.
And I figured out the scripting - I didn't need any of that. I've got several maps who's scripts I'm looking at for examples.
And I figured out the scripting - I didn't need any of that. I've got several maps who's scripts I'm looking at for examples.
I swear - by my life, and my love of it - that I will never live for the sake of another man, nor ask another man to live for mine.
OK, I'm having a lot of trouble with this - the scripting guide that Asheera pointed me to told me I would ;-).
I can't get a message to display on day two now, and I haven't even tried to get one to display when I enter an area, can someone give me a script for this?
Edit: This is my script. I want a prologue to display on day one and then a message to display on day two. When I check the script it says that Function Message1() isn't defined.
MessageBox("Maps/SingleMissions/asdf/Prologue.txt");
end;
function Message1()
if (GetDate(DAY) == 2) then
MessageBox("Maps/SingleMissions/asdf/Message1.txt");
end;
end;
Trigger(NEW_DAY_TRIGGER, "Message1");
I can't get a message to display on day two now, and I haven't even tried to get one to display when I enter an area, can someone give me a script for this?
Edit: This is my script. I want a prologue to display on day one and then a message to display on day two. When I check the script it says that Function Message1() isn't defined.
MessageBox("Maps/SingleMissions/asdf/Prologue.txt");
end;
function Message1()
if (GetDate(DAY) == 2) then
MessageBox("Maps/SingleMissions/asdf/Message1.txt");
end;
end;
Trigger(NEW_DAY_TRIGGER, "Message1");
I swear - by my life, and my love of it - that I will never live for the sake of another man, nor ask another man to live for mine.
- Grumpy Old Wizard
- Round Table Knight
- Posts: 2205
- Joined: 06 Jan 2006
- Location: Tower Grump
I don't see a mistake. Do you have any other code in the script file?John.Galt wrote:OK, I'm having a lot of trouble with this - the scripting guide that Asheera pointed me to told me I would ;-).
I can't get a message to display on day two now, and I haven't even tried to get one to display when I enter an area, can someone give me a script for this?
Edit: This is my script. I want a prologue to display on day one and then a message to display on day two. When I check the script it says that Function Message1() isn't defined.
MessageBox("Maps/SingleMissions/asdf/Prologue.txt");
end;
function Message1()
if (GetDate(DAY) == 2) then
MessageBox("Maps/SingleMissions/asdf/Message1.txt");
end;
end;
Trigger(NEW_DAY_TRIGGER, "Message1");
One possible thing is sometimes the game saves the message file pathe witht the slashses in the wrong direction so make sure the slashes are all facing like "/" Check it under the map propterties tree where you created the text file.
Frodo: "I wish the ring had never come to me. I wish none of this had happened."
Gandalf: "So do all who live to see such times but that is not for them to decide. All we have to decide is what to do with the time that is given to us."
Gandalf: "So do all who live to see such times but that is not for them to decide. All we have to decide is what to do with the time that is given to us."
Well, I put that in cause the first message stopped displaying when I put in the code for the second... I thought it was running together for some reason.
There's no other code though GOW, I'll check the slashes...
Yeah, it was that end, it's working now. Don't know why it wasn't working before I put that end in though. Can someone give me a script for triggering a message upon entering a region? I don't even know where to start with that...
I figured it out! I'm getting the hang of this I think. =D
There's no other code though GOW, I'll check the slashes...
Yeah, it was that end, it's working now. Don't know why it wasn't working before I put that end in though. Can someone give me a script for triggering a message upon entering a region? I don't even know where to start with that...
I figured it out! I'm getting the hang of this I think. =D
I swear - by my life, and my love of it - that I will never live for the sake of another man, nor ask another man to live for mine.
Code: Select all
function Message2(heroname)
MessageBox("Maps/SingleMissions/asdf/Message2.txt")
end
Trigger(REGION_ENTER_WITHOUT_STOP_TRIGGER, "RegionName", "Message2")
Note also that the trigger passes the Hero's (that entered the region) name as a parameter to the function; you may use it if you want.
NOTE:
REGION_ENTER_WITHOUT_STOP_TRIGGER - the hero enters the region (and does not have to stay within it)
But you could also use:
REGION_ENTER_AND_STOP_TRIGGER - the hero enters the region (and must stay within it)
I don't know which one you prefer.
No matter how powerful one becomes, there is always someone stronger. That's why I'm in a constant pursuit of power, so I can be prepared when an enemy tries to take advantage of me.
Yeah, thanks guys, I had already figured it out. =D I didn't make that clear in my edit, but thanks for everything. I'm sure I'll have more questions when I screw up again. =D
I swear - by my life, and my love of it - that I will never live for the sake of another man, nor ask another man to live for mine.
Well, I didn't see your edit, I was writing the message before you did itJohn.Galt wrote:Yeah, thanks guys, I had already figured it out. =D I didn't make that clear in my edit
No matter how powerful one becomes, there is always someone stronger. That's why I'm in a constant pursuit of power, so I can be prepared when an enemy tries to take advantage of me.
wondering how to make text box shows another days also. when i copy pasted first day code under it and change it day 10 and text file it comes day 1 and day 10.. do i have to to do something of it.
here is code:
MessageBox("Maps/Multiplayer/Dragon Sky/day1.txt");
-- only do this the first day
function NewDayTrigger()
if GetDate(DAY) == 1 then
-- do this first day only.
MessageBox("Maps/Multiplayer/Dragon Sky/day1.txt");
end;
end;
Trigger(NEW_DAY_TRIGGER, "NewDayTrigger");
so when i change that "if GetDate(DAY) == 1 then" line number 1 to 10 its still shows first day in game..
here is code:
MessageBox("Maps/Multiplayer/Dragon Sky/day1.txt");
-- only do this the first day
function NewDayTrigger()
if GetDate(DAY) == 1 then
-- do this first day only.
MessageBox("Maps/Multiplayer/Dragon Sky/day1.txt");
end;
end;
Trigger(NEW_DAY_TRIGGER, "NewDayTrigger");
so when i change that "if GetDate(DAY) == 1 then" line number 1 to 10 its still shows first day in game..
thx asheera it works once but when i remove scripts, because i failed bad way.. i need to wrote them again and i add more days, but now even day 8 not work can i wrote code like this.. i dont have clue how this script working.. i just copy pastes and changes things..
code:
------------------------------------------------------------------------------------------------
MessageBox("Maps/Multiplayer/Orcs Rage/day1.txt");
-- only do this the first day
function NewDayTrigger()
if GetDate(DAY) == 1 then
-- do this first day only.
MessageBox("Maps/Multiplayer/Orcs Rage/day1.txt");
end;
end;
Trigger(NEW_DAY_TRIGGER, "NewDayTrigger");
function NewDayTrigger()
if GetDate(DAY) == 8 then
--doFile this 8 day only
MessageBox("Maps/Multiplayer/Orcs Rage/day8.txt");
end;
end;
Trigger(NEW_DAY_TRIGGER, "NewDayTrigger");
function NewDayTrigger()
if GetDate(DAY) == 15 then
-- do this 15 day only.
MessageBox("Maps/Multiplayer/Orcs Rage/day15.txt");
end;
end;
Trigger(NEW_DAY_TRIGGER, "NewDayTrigger");
function NewDayTrigger()
if GetDate(DAY) == 30 then
-- do this 30 day only.
MessageBox("Maps/Multiplayer/Orcs Rage/day30.txt");
end;
end;
Trigger(NEW_DAY_TRIGGER, "NewDayTrigger");
code:
------------------------------------------------------------------------------------------------
MessageBox("Maps/Multiplayer/Orcs Rage/day1.txt");
-- only do this the first day
function NewDayTrigger()
if GetDate(DAY) == 1 then
-- do this first day only.
MessageBox("Maps/Multiplayer/Orcs Rage/day1.txt");
end;
end;
Trigger(NEW_DAY_TRIGGER, "NewDayTrigger");
function NewDayTrigger()
if GetDate(DAY) == 8 then
--doFile this 8 day only
MessageBox("Maps/Multiplayer/Orcs Rage/day8.txt");
end;
end;
Trigger(NEW_DAY_TRIGGER, "NewDayTrigger");
function NewDayTrigger()
if GetDate(DAY) == 15 then
-- do this 15 day only.
MessageBox("Maps/Multiplayer/Orcs Rage/day15.txt");
end;
end;
Trigger(NEW_DAY_TRIGGER, "NewDayTrigger");
function NewDayTrigger()
if GetDate(DAY) == 30 then
-- do this 30 day only.
MessageBox("Maps/Multiplayer/Orcs Rage/day30.txt");
end;
end;
Trigger(NEW_DAY_TRIGGER, "NewDayTrigger");
You can't have more functions with the same name. Rename them to NewDayTrigger1, NewDayTrigger2, etc
(also don't forget to change the lines with Trigger(NEW_DAY_TRIGGER)
(also don't forget to change the lines with Trigger(NEW_DAY_TRIGGER)
No matter how powerful one becomes, there is always someone stronger. That's why I'm in a constant pursuit of power, so I can be prepared when an enemy tries to take advantage of me.
Hello!
This my script, and it won't work. I really have no clue why. I have the text file created. There is no other script in this map. (Indeed there's nothing much in the map except two heroes and two towns.)
This my script, and it won't work. I really have no clue why. I have the text file created. There is no other script in this map. (Indeed there's nothing much in the map except two heroes and two towns.)
I really would highly appreciate some help.MessageBox("Maps\SingleMissions\Scripty\uzenet.txt");
Who is online
Users browsing this forum: No registered users and 0 guests