Notes

Posted by Shaun Biggs on Wed 08 Aug 2007 08:18 PM — 8 posts, 32,778 views.

USA #0
http://www.gammon.com.au/scripts/function.php?name=GetWorld

var noteworld;
  noteworld = GetWorld( "world 1" )
  if ( noteworld != null ) {
    noteworld.Note( "This will display in world 1." )
  }
Amended on Wed 08 Aug 2007 08:19 PM by Shaun Biggs
Australia Forum Administrator #1
What is the name of your other world?
USA #2
When you used the GetWorld command, did you make sure to change the name correctly to "tempolar ruin", or whatever is exactly in the world name?
USA #3
Try double checking the world names. If there's an error somehow, just grab the unique world id and use GetWorldById instead. Here's what you should run to get the list. It hasn't been tested, it's just a quick translation of a lua script I have.
worldlist = new VBArray(world.GetWorldIdList()).toArray();
for (i = 0; i < worldlist.length; i++)
  Note(worldlist[i] + " " + GetWorldById(worldlist[i]).GetInfo(2));


[edit] : stupid forum codes eating array access.
Amended on Thu 09 Aug 2007 05:54 AM by Shaun Biggs
Australia Forum Administrator #4
There are two names here - the file name, and the world name. The file name (which I gather is "tempolar ruin.mcl") is the name the world is save to disk as.

The world name, which appears in the title of the world window, is not necessarily the same. If you do this:


/ world.Note (world.GetInfo (2))


Does it print, exactly, "tempolar ruin"?

If it does, then Shaun's example should now read:


 noteworld = GetWorld( "tempolar ruin" )
  if ( noteworld != null ) {
    noteworld.Note( "This will display in world 1." )

USA #5
noteworld.ColourNote( "blue", "black", "This is blue with a black background")

Take a quick scan through this page: http://www.gammon.com.au/scripts/function.php Nick has made a LOT of functions that are quite self explanatory (and a few that are obscure). There are also great examples in each language for every scripting function listed on that page.

There is even a "see also" section after the description of the functions. ColourNote is the first other function listed in the page for Note.
Australia Forum Administrator #6
Quote:

how would i change its color? i tried

world.notecolour = 4;

and i tried (not that i read it existing)

notecolour.world = 4;


You need to get your spelling right. Your other world was "noteworld", so you might have got further with:


noteworld.notecolour = 4;


In this case "noteworld" is the world you want to do the action to, and "notecolour" is the attribute to change.

However, using ColourNote is a better idea.
USA #7
The see also section is wonderful. I've spent a lot of time flipping through various functions with that section. Just try poking that bit a little more frequently. Searching the forums helps out quite a bit though, especially the faq. If all else fails, as you've seen, posting a question usually gets answered within a day.