Well-Actually War Trall Balladeer Posted November 20, 2008 Share Posted November 20, 2008 OK, back into attempting to put things together with scripts and running into problems. Just trying to set up some stairways for mobility so I can walk around my scenario and the states aren't being called. I have made my town script 't2CAndreda2.txt' and placed it in the same folder as the rest of the stuff for the scenario. I have set Town Script in Town Details for town 2 to 't2CAndreda2' then I have the following code: Code: // TOWN SCRIPT// Town 2: Castle Andreda (lvl 2)begintownscript;variables;body;beginstate INIT_STATE; set_name(8,"Queen Rachel"); set_name(9,"Ambassador Corella"); set_name(10,"Sir Bualington"); set_name(11,"Lady Hintaly"); set_name(12, "Samantha");break;beginstate EXIT_STATE;// Always called when the town is left.break;beginstate START_STATE;// Starting state of the town, called every turn until you change the state.break;(Bunch of other states I haven't tested yet.)beginstate 29;//east stairway to lvl1 block_entry(1); move_to_new_town(1,49,17);break;beginstate 30;//west stairway to lvl1 block_entry(1); move_to_new_town(1,15,17);break;beginstate 31;//north stairway to lvl3 block_entry(1); move_to_new_town(3,32,15);break;beginstate 32;//south stairway to lvl3 block_entry(1); move_to_new_town(3,32,49);break; I have set nodes 29-32 on four stairway locations in the editor but in testing the party doesn't get moved to any new town when the set squares are stepped on. What am I missing? Quote Link to comment Share on other sites More sharing options...
Understated Ur-Drakon Celtic Minstrel Posted November 20, 2008 Share Posted November 20, 2008 Could it be the block_entry() calls? Try commenting those and see if it works. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Balladeer Posted November 20, 2008 Author Share Posted November 20, 2008 Nope. I would have though it might be them if it would actually block my entry but the states don't seem to be called at all. Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk Ephesos Posted November 20, 2008 Share Posted November 20, 2008 Try leaving town and re-entering it. That will reload the town, and it should update everything. Worth a shot, anyway. Quote Link to comment Share on other sites More sharing options...
Unflappable Drayk Lazarus. Posted November 20, 2008 Share Posted November 20, 2008 The script is fine. Make sure the party you're testing with has just entered the scenario (So don't use a save file with a party already in town 2.) If that's not it, insert some sort of message into the town start state to make sure the script is at least loading. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Balladeer Posted November 20, 2008 Author Share Posted November 20, 2008 I changed the start state to this: Code: beginstate START_STATE;// Starting state of the town, called every turn until you change the state. if (get_flag(2,29) == 250) end(); message_dialog("It's loading.",""); set_flag(2,29,250);break; and tried it with a brand new party. Nothing happened. I've triple checked my town details script spelling. It's the same as the name of the file. Edit 2:or does it only go to 29... *attempts again* Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Balladeer Posted November 20, 2008 Author Share Posted November 20, 2008 This laptop is Windows Vista. Would that make any difference? All right, it might help if I actually paid attention to the errors that the game gives me... *facepalm* Somewhere in that (bunch of states I haven't tested yet) are a couple of errors. I took them all out and it worked fine. Thanks for being a sounding board anyway. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Balladeer Posted November 20, 2008 Author Share Posted November 20, 2008 Next question, when debugging with the error's given, how do you count the lines of the scripts? Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk nikki. Posted November 20, 2008 Share Posted November 20, 2008 You have two options. You can either count through your scripts manually - I did this for a while, so it's possible, but it's a pain in the proverbial - or you can get a text editor with line numbers. I use Crimson Editor (download here), though it's an older version than the one available here. It's very easy to use, has a spell-checker, and will even colour your text so that comments, strings and so on all stand out. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Balladeer Posted November 20, 2008 Author Share Posted November 20, 2008 Is there anything you skip though? Because it told me that line 67 was over long and I counted down 67 lines and it ended on end(); I've tried skipping blank spaces or starting at body (all with word wrap off) and I've never landed on a long message. Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk nikki. Posted November 20, 2008 Share Posted November 20, 2008 No, I don't think you skip anything, except possibly blanks. Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk Ephesos Posted November 20, 2008 Share Posted November 20, 2008 Jewels, that could mean you've missed a quote mark on a string, or maybe missed a parenthesis or curly bracket (this thing: '{' ). Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Niemand Posted November 20, 2008 Share Posted November 20, 2008 In theory you shouldn't skip any lines when counting, no matter what. Early versions of the game used to count incorrectly, which caused problems, but I think that this has pretty much been fixed. Definitely use an editor with line numbering, and a good editor should have a 'Jump to line' feature, both will make life much easier. Also, hadn't someone around here written a syntax coloring scheme for Crimson Editor? That would be quite useful as well. Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk nikki. Posted November 20, 2008 Share Posted November 20, 2008 CE already has a C/C++ one that I find works quite well anyway. Quote Link to comment Share on other sites More sharing options...
Unflappable Drayk Lazarus. Posted November 20, 2008 Share Posted November 20, 2008 I did the manual counting thing for a while as well, it blows pretty hard. I switched to EditPad Lite, and then Notepad++. I'd highly recommend the later. Both have Go-to-line functions, but so should any halfway decent text editor. And yeah, overlong lines generally mean the previous string was missing a quote or something. I think parenthesis and brackets give "unmatched" error messages, but of course those are still worth checking because it's easy enough to check and it's a common error. Quote Link to comment Share on other sites More sharing options...
Easygoing Eyebeast Dintiradan Posted November 20, 2008 Share Posted November 20, 2008 Even Window's Notepad has go-to-line functionality (CTRL-g). Wordpad does not as far as I know. Quote Link to comment Share on other sites More sharing options...
Unflappable Drayk Lazarus. Posted November 20, 2008 Share Posted November 20, 2008 Oh yeah, turn off word wrap when you're counting lines. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Ishad Nha Posted November 20, 2008 Share Posted November 20, 2008 All scripts should be checked with the Alint program, which you can get from: http://home.sanbrunocable.com/~tommywatts03/page/alint.exe.zip It is a Command Prompt program, which must be run your MS-Dos Prompt program. Unless you have a Mac. This is not perfect, see this post: http://www.ironycentral.com/forum/ubbthreads.php?ubb=showflat&Number=53245&page=1 All the best BoA utility programs are made for Mac OS, you might actually want to get a Mac. Edit: You will need to manually copy and paste the Alint hyperlink into your address bar, then press Enter. This forum (or Internet Explorer?) is not recognizing it as a link. Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk nikki. Posted November 20, 2008 Share Posted November 20, 2008 Alint is alright, but I've not used it since TV, which was years ago. It doesn't show you anything the game itself can't. Also, yes, lets all buy Macs to design on. After all, money grows on trees. *rolls eyes* Quote Link to comment Share on other sites More sharing options...
Easygoing Eyebeast keira Posted November 20, 2008 Share Posted November 20, 2008 Originally Posted By: Jewelz Next question, when debugging with the error's given, how do you count the lines of the scripts? http://notepad-plus.sourceforge.net/uk/site.htm I use it for EVERYTHING. Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk Ephesos Posted November 20, 2008 Share Posted November 20, 2008 I mean, I'll agree that the better programs tend to be for Mac (thanks Niemand!), but that doesn't mean it's impossible to design on a PC. I second the other suggestions in this thread. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Balladeer Posted November 20, 2008 Author Share Posted November 20, 2008 Ok, I know I've read it before but the number itself and exactly where escape me. I've spent 30 minutes trying to find it again with no luck so I'm just going to ask. What is the maximum character count on a message_dialogue? ("How many characters", "plus how many characters?") Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk nikki. Posted November 20, 2008 Share Posted November 20, 2008 256 (which BoA will count as 255 (0-255), and 256. Post the script, or, if it's too spoilery, PM it to me, and I'll have a look. Quote Link to comment Share on other sites More sharing options...
Unflappable Drayk Lazarus. Posted November 20, 2008 Share Posted November 20, 2008 255 characters per string. message_dialog takes two strings, so double that. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Balladeer Posted November 20, 2008 Author Share Posted November 20, 2008 Way too spoilery to post but I think I can fix it with that info. *goes to look up that 'continue state x' call* Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk nikki. Posted November 20, 2008 Share Posted November 20, 2008 If you want to give the player a big block of text, you could do this: Code: reset_dialog(); add_dialog_str(0,"255 characters",0); //the first number is the string number//then goes the actual text//then the indentation (0 means no indent)add_dialog_str(1,"",0);... //as many more as you likerun_dialog(1); //this actually displays the text. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Balladeer Posted November 21, 2008 Author Share Posted November 21, 2008 See, this is why I procrastinated and didn't look it up yet. Thanks for all the help, everyone. Quote Link to comment Share on other sites More sharing options...
Easygoing Eyebeast Dintiradan Posted November 21, 2008 Share Posted November 21, 2008 Actually, when I was writing the Windows version of astring astring, I believe I found that 254 was the maximum allowed number of characters in a string, not 255 as documented. I'd have to verify. It's been a while, but I believe that my astring checks this. If it does, I sure don't want to touch that code to make it do so. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Balladeer Posted November 21, 2008 Author Share Posted November 21, 2008 My town scripts don't cause errors anymore at least. Moving on: How do you get rid of Wandering Monster Spawn Points that the game automatically sets when it makes the town, or do I not need to worry about these? Quote Link to comment Share on other sites More sharing options...
Understated Ur-Drakon Nioca Posted November 21, 2008 Share Posted November 21, 2008 You can't actually get rid of the WMSPs, but the points don't do anything by themselves. No worry necessary. Quote Link to comment Share on other sites More sharing options...
Understated Ur-Drakon Celtic Minstrel Posted November 23, 2008 Share Posted November 23, 2008 Originally Posted By: Dintiradan I believe I found that 254 was the maximum allowed number of characters in a string, not 255 as documented. This could easily be the case if he used strings with a length byte rather than null-terminated strings. I know that all the pre-Carbon (and probably also Carbon) Mac GUI commands take length-byte strings due to the libraries originally being written in Pascal. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Niemand Posted November 23, 2008 Share Posted November 23, 2008 Pascal strings could be the same length in the same space as a C string, for instance, a length byte could go up to 255 allowing for 255 characters to follow it, all within a 256 byte buffer. The Carbon Libraries use CFStrings, which almost certainly store their size completely separately from the string data. Neither of these explains what Jeff did; he used C strings and just limited their length to be less than 255 characters. If your curious about how the game does this, the editor code contains an old version of the code; take a look in EdParser.cpp at script_type::load_script(); it's by the comment that says "create string data". Quote Link to comment Share on other sites More sharing options...
Understated Ur-Drakon Celtic Minstrel Posted November 23, 2008 Share Posted November 23, 2008 *smacks forehead* D'oh, of course Pascal strings could still be 255 characters long. I guess what he did was decide that the size limit for the strings would be 255 characters, and then declared a char[255] array, forgetting that one of those has to be a null character. Or something like that. It sounds like the CFStrings are basically a wrapper for the earlier library's Pascal strings. Quote Link to comment Share on other sites More sharing options...
Easygoing Eyebeast keira Posted November 23, 2008 Share Posted November 23, 2008 Do Pascal strings have any relation to the triangle? Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Ishad Nha Posted November 23, 2008 Share Posted November 23, 2008 No, I doubt that the Pascal computer language has any connection to the original Blaise Pascal. Presumably it has no more connection than any other language. Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk Ephesos Posted November 23, 2008 Share Posted November 23, 2008 Okay, long story short, don't go over 250-ish characters in a string. Quote Link to comment Share on other sites More sharing options...
Easygoing Eyebeast Enraged Slith Posted November 23, 2008 Share Posted November 23, 2008 How many should you avoid overall? I know in KTD, I had to shorten one section of strings because it ran off the screen. Quote Link to comment Share on other sites More sharing options...
Easygoing Eyebeast keira Posted November 23, 2008 Share Posted November 23, 2008 250-ish Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Niemand Posted November 23, 2008 Share Posted November 23, 2008 The tricky part with that is that since the game doesn't used fixed width fonts you can fit different numbers of different letters into various spots. For instance 'i' takes up less width than 'w', so the amount of 'i's that will fit somewhere will be much higher than the number of 'w's. Also, I'm not sure that the font rendering is quite the same in the Macintosh and Windows versions, so testing each specific case as it comes up is about the only way to to be sure. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Balladeer Posted December 12, 2008 Author Share Posted December 12, 2008 Is there a reason Jeff and many others only put ten terrain graphics on each sheet? The documentation makes it sound like you could put all of your terrain graphics on one sheet and all of the small icons on a second sheet and be done. Coming from BoE I prefer keeping as much together as possible. Is there any reason I shouldn't? Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Niemand Posted December 12, 2008 Share Posted December 12, 2008 You can put up to 100 terrain graphics in a sheet, but the row length must be exactly 10. (Otherwise, the game wouldn't know where to find an arbitrarily numbered graphic. Also, I believe 100 is the limit, but I haven't bothered to test going further.) I prefer to try to group icons that belong together on the same sheet when possible, and use different sheets for things that aren't related. This makes it easier to work with going from the base art in my graphics editor to the sheets I put into the game. So, you can lump things together if you want, but at some point you would need to split them up somewhat anyway, so why not do it sooner to aid organization? Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk Ephesos Posted December 12, 2008 Share Posted December 12, 2008 Yeah, I tend to lump them together more often than not. It's more or less a matter of personal preference. Quote Link to comment Share on other sites More sharing options...
Understated Ur-Drakon Nioca Posted December 12, 2008 Share Posted December 12, 2008 Originally Posted By: Jewelz The documentation makes it sound like you could put all of your terrain graphics on one sheet and all of the small icons on a second sheet and be done. That's correct. In fact, you can put the floor and terrain graphics in the same sheet. Originally Posted By: Niemand You can put up to 100 terrain graphics in a sheet, but the row length must be exactly 10. (Otherwise, the game wouldn't know where to find an arbitrarily numbered graphic. Also, I believe 100 is the limit, but I haven't bothered to test going further.) You can go far past 100; one of my graphics sheets is approaching 150 icons, and it works just fine. As for me, I prefer to keep all things of a certain sort together if possible, which is why G500 in my projects thus far tends to consist of every custom floor and terrain graphic in the scenario. Having to search through multiple graphics is a pain in the rear, to say the least. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Ishad Nha Posted December 13, 2008 Share Posted December 13, 2008 Thumbnails view in Windows XP makes it far easier than it used to be, then there is the Windows Picture and Fax Viewer. These days it is a matter of personal preference. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Balladeer Posted December 13, 2008 Author Share Posted December 13, 2008 I've been working on the Vista laptop so I can have actual size icons if I want. But when editing I'd rather have just one file to open as opposed to many. In other news, I'm pretty sure I'm not going to make the deadline... I haven't even gotten the Christmas tree up yet and the kids have been bugging me for a week. Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk nikki. Posted December 13, 2008 Share Posted December 13, 2008 Don't worry Jewels. From the sounds of it, nobody else is going to, either. Quote Link to comment Share on other sites More sharing options...
Understated Ur-Drakon Celtic Minstrel Posted December 13, 2008 Share Posted December 13, 2008 Originally Posted By: Jewelz Is there a reason Jeff and many others only put ten terrain graphics on each sheet? The documentation makes it sound like you could put all of your terrain graphics on one sheet and all of the small icons on a second sheet and be done. Coming from BoE I prefer keeping as much together as possible. Is there any reason I shouldn't? No. I'm putting 99% of my terrain graphics on a single sheet. I have a few other sheets for groups of related graphics (eg waterfalls, dirt roads) but most are on a single sheet. Also, your map graphic sheets do not need to mirror your terrain graphic sheets, like the ones in the graphics files do. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Balladeer Posted December 14, 2008 Author Share Posted December 14, 2008 What's Jeff got against the library? Three different bolts of cloth, three seperate heaps of trash but not a single book in the bunch! Guess I'm not done adding graphics... /rant Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk Ephesos Posted December 14, 2008 Share Posted December 14, 2008 I seem to remember that A3 has a bunch of book graphics. Kel's HLPM has at least the one. Quote Link to comment Share on other sites More sharing options...
Seasoned Roamer Old MikeS Posted December 14, 2008 Share Posted December 14, 2008 There are five book graphics already available, you just need to define them in your data file. The sheets and icon/inventory indexes are as follows: ; first it_floor_which_sheet = 1026; it_floor_which_icon = 0; it_inventory_icon = 0; ; second it_floor_which_sheet = 1026; it_floor_which_icon = 1; it_inventory_icon = 1; ; third it_floor_which_sheet = 1026; it_floor_which_icon = 2; it_inventory_icon = 2; ; fourth it_floor_which_sheet = 1026; it_floor_which_icon = 3; it_inventory_icon = 3; ; fifth it_floor_which_sheet = 1032; it_floor_which_icon = 0; it_inventory_icon = 1; I think Kelandon's custom object script includes these as well. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.