I can't get a message to display

Maps and the art of mapmaking.
User avatar
John.Galt
Pixie
Pixie
Posts: 141
Joined: 29 Jul 2008
Location: The Utopia of Greed

I can't get a message to display

Unread postby John.Galt » 07 Aug 2008, 15:11

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.

User avatar
Grumpy Old Wizard
Round Table Knight
Round Table Knight
Posts: 2205
Joined: 06 Jan 2006
Location: Tower Grump

Re: I can't get a message to display

Unread postby Grumpy Old Wizard » 07 Aug 2008, 15:20

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");
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.

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."

User avatar
John.Galt
Pixie
Pixie
Posts: 141
Joined: 29 Jul 2008
Location: The Utopia of Greed

Unread postby John.Galt » 07 Aug 2008, 15:39

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.
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.

User avatar
John.Galt
Pixie
Pixie
Posts: 141
Joined: 29 Jul 2008
Location: The Utopia of Greed

Unread postby John.Galt » 08 Aug 2008, 17:25

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 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.

User avatar
Grumpy Old Wizard
Round Table Knight
Round Table Knight
Posts: 2205
Joined: 06 Jan 2006
Location: Tower Grump

Unread postby Grumpy Old Wizard » 08 Aug 2008, 18:25

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");
I don't see a mistake. Do you have any other code in the script file?

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."

User avatar
Asheera
Round Table Knight
Round Table Knight
Posts: 4506
Joined: 06 Jul 2008
Location: The Shadows
Contact:

Unread postby Asheera » 08 Aug 2008, 18:30

What's with that end after the first MessageBox?
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.

User avatar
John.Galt
Pixie
Pixie
Posts: 141
Joined: 29 Jul 2008
Location: The Utopia of Greed

Unread postby John.Galt » 08 Aug 2008, 18:32

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
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.

User avatar
Asheera
Round Table Knight
Round Table Knight
Posts: 4506
Joined: 06 Jul 2008
Location: The Shadows
Contact:

Unread postby Asheera » 08 Aug 2008, 18:44

Code: Select all

function Message2(heroname)
  MessageBox("Maps/SingleMissions/asdf/Message2.txt")
end

Trigger(REGION_ENTER_WITHOUT_STOP_TRIGGER, "RegionName", "Message2")
RegionName is the name of your region obviously.

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.

Franzy
War Dancer
War Dancer
Posts: 362
Joined: 07 Sep 2007
Location: Moscow, Russia
Contact:

Unread postby Franzy » 08 Aug 2008, 18:51

Official descriptions are not correct. Correct descriptions:

REGION_ENTER_AND_STOP - hero entering the region will be stopped, and the script executed.

REGION_ENTER_WITHOUT_STOP - Script will be executed when hero enters the region, but his movement will not be interrupted.

User avatar
John.Galt
Pixie
Pixie
Posts: 141
Joined: 29 Jul 2008
Location: The Utopia of Greed

Unread postby John.Galt » 08 Aug 2008, 19:19

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.

User avatar
Asheera
Round Table Knight
Round Table Knight
Posts: 4506
Joined: 06 Jul 2008
Location: The Shadows
Contact:

Unread postby Asheera » 08 Aug 2008, 19:28

John.Galt wrote:Yeah, thanks guys, I had already figured it out. =D I didn't make that clear in my edit
Well, I didn't see your edit, I was writing the message before you did it :D
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.

User avatar
John.Galt
Pixie
Pixie
Posts: 141
Joined: 29 Jul 2008
Location: The Utopia of Greed

Unread postby John.Galt » 08 Aug 2008, 19:42

:-P Thanks anyway.
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.

User avatar
Belchior
Peasant
Peasant
Posts: 57
Joined: 17 May 2009
Location: Finland
Contact:

Unread postby Belchior » 17 May 2009, 18:57

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..

User avatar
Asheera
Round Table Knight
Round Table Knight
Posts: 4506
Joined: 06 Jul 2008
Location: The Shadows
Contact:

Unread postby Asheera » 18 May 2009, 01:46

Because you have the first line rofl, remove it :) (before the function)
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.

User avatar
Belchior
Peasant
Peasant
Posts: 57
Joined: 17 May 2009
Location: Finland
Contact:

Unread postby Belchior » 19 May 2009, 17:56

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");

User avatar
Asheera
Round Table Knight
Round Table Knight
Posts: 4506
Joined: 06 Jul 2008
Location: The Shadows
Contact:

Unread postby Asheera » 19 May 2009, 19:05

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)
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.

User avatar
Belchior
Peasant
Peasant
Posts: 57
Joined: 17 May 2009
Location: Finland
Contact:

Unread postby Belchior » 19 May 2009, 19:54

thx i change and try.

Galev
Leprechaun
Leprechaun
Posts: 28
Joined: 11 Jun 2009

Unread postby Galev » 11 Jun 2009, 18:07

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.)
MessageBox("Maps\SingleMissions\Scripty\uzenet.txt");
I really would highly appreciate some help. :(

User avatar
Belchior
Peasant
Peasant
Posts: 57
Joined: 17 May 2009
Location: Finland
Contact:

Unread postby Belchior » 11 Jun 2009, 18:34

MessageBox("Maps/SingleMissions/your map name/day1.txt");
remember wrote map name exact right so attention for capitals on map name
dunno other on this. i hope this helps you.

Galev
Leprechaun
Leprechaun
Posts: 28
Joined: 11 Jun 2009

Unread postby Galev » 11 Jun 2009, 18:51

The map name was correct

But I have an idea:

is it supposed to be this: \
or this: / ???

You used this: /
I used this: \ (editor used that symbol by default) I though it is right, because file paths use that symbol... like c:\Programfiles\Ubisoft\Heroes5\Maps and things...

Thank you anyway :)


Return to “Mapmaking Guild”

Who is online

Users browsing this forum: No registered users and 3 guests