View Full Version : Work around for Texting in Editor (broken?)
Pi-Xerxes
10-02-2006, 12:27 AM
You can not edit or add your custom scenario Story or Instructions within the editor. If you click on "S" and try to add a written story line or the Goal displays using the Editor, it will not work.
I figured out how to add add the "Story and Instructions" text to your scenario.
It is done by the external file call (your scenario name) Map.xml.
Yes, that is correct, you must make or modify an existing XML document to change the wording so it will display when you load up your scenario.
Simple enough for average modder, but not so obvious how it was done! Not from inside the Editor. Just letting you know.
For me the Editor only crashed once ( I was really trying to break it). If you follow these 'notes' it will help you make your first scenario.
I hope TM can patch up the Editor in the future to make it more N00b friendly. ;)
----------
Here is an example of Test.xml modfied from Capua.xml to work with my beta test scenario.
-------------
<?xml version="1.0" encoding="utf-8"?>
<Test>
<StringTable>
<!--CHANGED 7/18-->
<String id="OVERVIEW">Beta Test text. Welcome Beta tester, and you thought this was going to be FUN. Have a population of over 1000.</String>
<String id="HISTORY"></String>
<String id="HINTS"></String>
<String id="AFTERMATH"></String>
<String id="SCENARIONAME">Test</String>
<String id="WIN">You have created a wonderful city and made through this all so fun Beta phase of this Editor Test Scenario.</String>
<!-- Added 8 21 -->
<String id="LOSE">You must prove your ability to be a proper beta tester, N00b. Guards! </String>
<String id="POPULATION">1000</String>
<String id="FAVOR"></String>
<String id="CULTURE"></String>
<String id="PROSPERITY"></String>
<String id="SECURITY"></String>
<String id="SITE_0_LABEL">Test</String>
<String id="SITE_0_FULLNAME">Test</String>
<String id="SITE_0_SITETYPE">Beta City</String>
<String id="SITE_0_OPEN">Test\nN00b City</String>
<String id="SITE_0_CLOSED">!</String>
<String id="SITE_0_HISTORY">!</String>
<String id="SITE_0_DEACTIVE">!</String>
</StringTable>
</Test>
Kuplo
10-02-2006, 04:11 PM
Easy enough,
<StringTable>
<!--CHANGED 7/18-->
<String id="OVERVIEW">Beta Test text. Welcome Beta tester, and you thought this was going to be FUN. Have a population of over 1000.</String>
<String id="HISTORY"></String>
<String id="HINTS"></String>
<String id="AFTERMATH"></String>
I assume we just insert out text inbetween the >< for the History, hints and aftermath.
I figured this out after the dev said that it doesnt work and we need to edit the xml files although before he said something I was wondering why the editor doesnt produce these xml files itself by allowing us to type into the editors space for the information, but it is what it is.
The xml part is not so difficult in fact if people know html then it really shouldnt be that much of a bother, other than remembering to actually do it and to include the file with any scenarios that people make available for others to download. The one thats looking like it's going to be the tuffy would be the cs files. Do you know if they are created by the game automagically or must they be hand created? I would assume that they are created by the editor since they seem more complex than the simple xml
I'd try it but as you know, crash city right now.
Will Jennings
10-02-2006, 04:46 PM
We made those files in freely available XML editors (since they're so much better at editing XML than anything we could have made the time to cook up ourselves in the editor).
The controls now in the editor are remnants of an earlier system, when that text was embedded directly into the scenario file (fine for early development, but not so good when you want to translate that into many languages)
Pi-Xerxes
10-02-2006, 04:49 PM
The editor will not create the .cs files. You must script them in manually. I just use Wordpad. Nothing fancy.
I do not know alot of Python, but I can figure out how to cut and paste routines in and what commands do what. I modify existing scripts.
You can add via script.cs file events, even non-violent ones such as maybe achieve 1000 Weapons within a set number of years ( I have not seen an official script for a goal like this, but I am pretty good at back engineering code.. :D ).
I believe this is the best editor we will have for awhile. TM seems to have their plate full fixing crashes that plague a unknown amount of people.
I am lucky, it appears you are having crashes. I hope that is ameliorated (my spelling is bad). I am glad you can write PDF guide files for people to read. I would not have a clue on how to do it.
They will need a guide to make maps and scenarios for what we have to work with...it is not easy, but it is doable. Else, people may lose interest who have talent and neat ideas for scenarios. I am not much of an artist when it comes to making pretty maps. I mostly know the technical stuff to a point.
EDIT: TM post, that would explain why that it is. I can see the text inside the .scn files.
If I can ask Will Jennings, what are the .sco files used for? They seem to be just a backup of the .scn file.
Kuplo
10-02-2006, 05:14 PM
Thanks,
I just tried to create a map (no crashes this time and I think I no know why, but I'll save that thought to make sure before I say anymore on it), but I tried painting down some sand using the sample tool on the default map and then saved it as test and I also saved the terrain textures and when I opened up the scenario in the game the entire map was now sand colored. Aaaaaahhhhhhhhh
Im really off to a bad start here.
Okay as to the cs files yeah, I just found out that any goals that I might have been able to set in the game some of them save to the file and others just dont work at all.
For example I wanted to set the different attribute point ratings that people would have to meet to win the scenario but the after choosing Effect: Victory OR and category: Attributes there is no longer anything that is settable other than the = or => etc but not actual choice, so Im guessing that these types of goals would need to be set in the cs file which is a shame. So while that part didn't work, the obsolete or left over part about clay did allow me to set a request for 50,000 of them and that saved itself into the scn file somewhere because I did get a request for the 50,000 clay, so it was probably left in in case they decide to fix this thing and put all of the stuff back into here.
I fully understand why they would want to break the text out of the scn file so that it could be made for each language. However the scripting thing being done by hand is an awful mistake in my opinion.
I've been looking at the cs files and the majority of stuff I've found so far would be military invasions and things along those lines, I haven't opened the right cs file so far that has an example of the ratings to win.
After looking at a few of the xml files they seem to hold all of the text that will appear in the game such as requests etc. But not the actual request so I have to assume that the actual request will have to be in the .cs file since I havn't "stumbled" upon how to set them in the actual editor.
I have to admit Im a tad disapointed with this situation with the editor because quite honestly the editor and the scenarios that people will be able to create are a HUGE amount of the value of the game and with the editor needing the user to move around files, and hand edit files (even if that means only cutting and pasting) is going to severely reduce the amount of scenarios that we will be seeing for this game made by users.
I hope that in 6 months time I can revisit this thread and post that I was completely wrong, however with the way that the editor works currently I really dont see many people attempting to tackle it to any great degree. But certainly we may see scenarios that are nothing more than a different looking map with no events and or requests unless the editor actually does create these through an intuitive system inside of the editor because the average gamer that wants to create their own maps is not going to try to learn a programming language to accomplish creating their own map.
But also on the good side of both Sierra and TM, theres nothing on the box that I can find that says the game comes with a map editor, so they certainly wouldnt get anybodys hopes up that had not followed the game to any great degree and that only read the outside of the box in the store in regards to the editor.
And finally, I used to think that the COTN editor was a nightmare to work with, but it is a cakewalk compared to this thing.
I dunno, Im probably doing it all wrong and hoping that it will show itself in due course, but right now it seems there is too much stuff spread out all over the place that needs to be done manually.
I'd prefer it if they hid or removed any of the obsolete features so that I am not confused about what works in the editor and what doesn't work, that might make it a bit easier to keep track of what I can use and what I can't use. And of course I know it's not on the high priority list right now and it may never be.
Pi-Xerxes
10-02-2006, 06:25 PM
When I tried to use Sample, paint then save -I also got the the whole sand color too. It was in a post awhile back. I use the regular sliders on the textures to paint sand, do not use sample function. The texture trick work around is a bit odd and must be followed regerously (exactly -bad spelling).
THe only thing that the editor does inside itself is the Attributes function only for goals. You can set them in the five categories of rating to achieve.
You can definitely creat Request and Demands within the editor quite easily (but not obvious). It is done under the "P" Players tab, then click on the box in the lower left side of the screen. It will display Events (does not work, those are done by script.cs files); Building Restrictions (works); and most importantly Request/Demands. Click on that will bring up the interface.
If you load up a current scenario, use it as a guide to show you how to set up Request and Demands, when they occur, variation in time, repeats, favor gained or lost (even a Demand can give you a boost in favor if fullfilled if you wish. Default game has it set for 0).
The biggest problem to learn the editor, I spent hours looking at scenarios at seen how they did things. Alot of trial and error. Of course it is cumbersome, but I am lucky to have one.
First lets start with the basics. What topic do you think should be done first to expediate the editor usage? Once you get familiar, it is not bad. It would be daunting for someone not versed just clicking on it and going to town.
We can make pictures and documention to help people (and even myself:rolleyes: ). It does seem thing worth having always take alot to get -nature of things.:)
Here's is a picture of where you can set up Demand and Requests:
Kuplo
10-02-2006, 07:59 PM
Yours is working a whole lot different that it is for me on my computer. I've been to the screen that you show in your second screenshot and it looks like it does in the screenshot.
But when I choose the 0 for the category, nothing shows up in my object drop down list.
Im guessing at this point that whats happening is that I must be doing something else in the editor that could be messing up the whole thing.
Right now Im in the middle of trying to figure out how to recover a hard drive that was used in a Linux server and windows only reports it as having 33GB when it's a 200GB hard drive so once Im done with that, I'll try the editor again and not do anything other than let it load the default scenario and then try the goals again to see if the dropdown list appears of my different choices.
But I do know that I can't type into the text boxes that you can. i can type into the first text box where you have written Request for Grain, but where it says "A festival...." I can't type into that box.... Is this also controlled through the xml file? Im guessing that it is and as such we also need to figure out how the requests named coincide with the xml file so that they go together.
Anyway, I think that the first topic that should be convered to help people to using the editor would be to do something like "The editor at first glance" and it would include a screenshot of each screen that is available in the editor and then explain what each function does, and which ones work and which ones don't work. That would be the best way of starting to help people with the editor in my opinion. Because the editor is so finiky in what it can do and what has been removed or is obsolete in it, then a basic guide on what each function does and which ones no longer work I think is best.
wodinoneeye
10-03-2006, 08:42 PM
The editor will not create the .cs files. You must script them in manually. I just use Wordpad. Nothing fancy.
I do not know alot of Python, but I can figure out how to cut and paste routines in and what commands do what. I modify existing scripts.
You can add via script.cs file events, even non-violent ones such as maybe achieve 1000 Weapons within a set number of years ( I have not seen an official script for a goal like this, but I am pretty good at back engineering code.. :D ).
I believe this is the best editor we will have for awhile. TM seems to have their plate full fixing crashes that plague a unknown amount of people.
I am lucky, it appears you are having crashes. I hope that is ameliorated (my spelling is bad). I am glad you can write PDF guide files for people to read. I would not have a clue on how to do it.
They will need a guide to make maps and scenarios for what we have to work with...it is not easy, but it is doable. Else, people may lose interest who have talent and neat ideas for scenarios. I am not much of an artist when it comes to making pretty maps. I mostly know the technical stuff to a point.
EDIT: TM post, that would explain why that it is. I can see the text inside the .scn files.
If I can ask Will Jennings, what are the .sco files used for? They seem to be just a backup of the .scn file.
If there is to be alot of scripting to create scenarios, then TM needs to make available their reference documentation for all the calls to the game mechanics and data structures. They must have some internal documentation that the programmers provided to their scripters that wont take them much effort to place online.
Kuplo
10-03-2006, 08:58 PM
If there is to be alot of scripting to create scenarios, then TM needs to make available their reference documentation for all the calls to the game mechanics and data structures. They must have some internal documentation that the programmers provided to their scripters that wont take them much effort to place online.
I would have to agree here. This is one of the .cs script files and quite honestly unless people know how the mechanics of this stuff works, there will be a bunch of very vanilla flavored maps:
using System;
using RomeScriptInterfaces;
namespace Scripts
{
/// [Serializable]: keeps variables across saves
[Serializable]
public class Brundisium : ScriptServer.IScript
{
//
/// private data -- persistent on save/load
//
private enum EventList : uint
{
kScriptStart,
kMsgWalls,
kWaitGatehouses,
kMsgWeapons,
kWaitMakeWeapons,
kMsgMilitaryBuildings,
kWaitMakeACohort,
kMsgInvaders,
kWaitInvaders,
kWaitVanquishInvaders,
kGoalAlmostThere,
kPauseState,
kLoadState,
kScriptDone, // We'll check for this at the end to set ScriptDone to true
kShowTip,
}
//for invasion
private TMilitaryAI mMilitaryAI = null;
private InvasionSetup mInvasion = null;
// for our messaging
private String kMessageSound = "message1.mp3";
private String msgTitle;
private String msgText;
private EventList scriptState = EventList.kScriptStart;
//variable to track number of ticks since script start
private int nTicks = 0;
private uint nTimeStateStart = 0;
//variables for pause function
private EventList returnState = EventList.kScriptStart;
private EventList loadState = EventList.kScriptStart;
private int nUnpauseTick = 0;
//standard wait time before messages, in ticks
private const uint kMsgWaitTime = 1;
// tip message-related
private EventList lastState = EventList.kScriptStart;
private UInt32 kTipDeadline = 5000; // how long can we wait before we must show a tip?
private bool bShowedTip = false;
// UI control locking
private bool mAllowMilUI = false;
private Int32 mUIArmory = IDMaker.FromString("MIL_ARMORY");
private Int32 mUIFortLt = IDMaker.FromString("FORT_LT");
private Int32 mUIMessHall = IDMaker.FromString("MIL_MESS_HALL");
private void LockSpecialUIControls(IGameQueryInterface game)
{
game.LockUIControl(mUIArmory, Toolset.MainGameFormID);
game.LockUIControl(mUIFortLt, Toolset.MainGameFormID);
game.LockUIControl(mUIMessHall, Toolset.MainGameFormID);
}
private void UnlockSpecialUIControls(IGameQueryInterface game)
{
existenz
10-04-2006, 12:25 AM
Hi. I made a scenario that worked and which I won. But.... I didn't use a cs file as they just baffle me:) . I won by fulfilling the goals and attributes I set in the editor such as have a certain amount of a resource stored and favor of.... etc. The ratings attributes also showed up correctly in the win screen. All requests came through ok but it was annoying to not be able to show what attributes were needed to win at the opening scene, I also wanted to set up a hint or two. I for one, hope that TM or someone eventually will be able to do a tutorial in modifying cs files, modifying the xml file is fairly straightforward compared to the cs file. I love making scenarios as I have for CoTN and hope that when the initial rush of "I can't play the game as it crashes etc" problems get ironed out that TM will be able to settle back and put out an unofficial tutorial for the editor, or even better a patch that puts the text back in the editor so we don't have to modify cs files. XML I can handle, cs no!!:D I was also wondering, if I upload the scenario and the xml, sco and scn etc files would someone be able ( like Pi-Xerxes:D ) be able to modify a cs file to get the attributes and hint at the beginning to work. Then I could at least see what hes done and work from there.
Kuplo
10-04-2006, 01:09 AM
Modify one of the existing xml files and name it the same name as your custom scenario, the xml files are nothing more than simple english language text and have a place for everything and everything in it's place.
This should allow you to set some of the text that you want.
Personally Im still struggling with editor crashes, although I thought I had it worked out.
My next step is a complete reinstall of windows xp which I might try tommorrow night and if that doesnt solve it, then I'll play out the original scenarios then dump it on ebay and try to recooperate what I can for it.
Yes TM, the editor really does mean that much to me! :(
existenz
10-04-2006, 01:21 AM
Thanks Kuplo for the reply. I did modify the xml file which I believe is why my two requests I put in the scenario worked. Still haven't a clue on altering cs files tho'.:)
Edit: Just realised you meant altering xml to add hints etc - will try that. Thanks again. I hope your reinstall helps to eliminate your editor crashes. The only time the editor wouldn't work for me was when I added a copied cs file with the test scenario name on it. it wouldn't let me edit the scenario, crashed and said something like Caesar 4 cannot find script file.
Edit2: Did add the attribute ratings to the xml file but it still did not show up at the opening screen.
Will Jennings
10-04-2006, 09:21 AM
What are the .sco files used for? They seem to be just a backup of the .scn file.
They're the online scenarios (mostly very similar to the single player ones, as you've noted).
Pi-Xerxes
10-04-2006, 03:44 PM
Thank you for the reply Will Jennings. Since my custom scenarios are not directed at online play -it will save upload space. :)
@ Existenz
Did add the attribute ratings to the xml file but it still did not show up at the opening screen
I made a scenario and the goal screen shows fine the Ratings goal. You must place this text inside the XML file as shown above. To see proof look at the other thread under 'Our Editor Guide' .
If you are only doing a Ratings goal using just Request and Demands, that can be done inside the Editor tool totally without any .sc file. IE you need no .sc file to go with the basic scenario.
The .sc file has external events such as Invasions, fires, disasters, tutorial, etc. Rather handy for me to spice up a scenario.
See this part of the XML Original Post, this is what gives display on the Splash screen..
<String id="POPULATION">1000</String>
<String id="FAVOR"></String>
<String id="CULTURE"></String>
<String id="PROSPERITY"></String>
<String id="SECURITY"></String>
BTY Anyone figure out how to rotate maps within the editor to see around full 3D? Making the back side of a hill is hard to see it.
existenz
10-04-2006, 06:55 PM
Thanks for the reply. I did change the xml file as suggested but it still did not show in the initial screen unlike yours. Hmmm.. in the shots above of the changes to the xml file you had something like <StringTable>
<!--CHANGED 7/18-->
I didn't do that - I'll try it and see if it makes a difference.:)
Edit: Well so far no go - maybe because you did a new map not just an existing one and edited the cs file? Anyway going to upload my scn, and xml file so maybe someone can fiqure out what needs to be done if thats ok.
Pi-Xerxes
10-04-2006, 09:14 PM
OK, first, you must set up your request and demands in the editor if you want them to be in the game.
Second, it cannot be a word doc. Use a 'pure' XML such as Wordpad. Please reload as a txt file such as Capua.txt or Capua.xml. Microsoft Word cannot create the proper format. It must be 'pure'.
The written text that is in the XML will show up in the Advisor Imperial Screen..as yo can see in my example above and in thumbnail I left that out for now.
For Request text to appear in the game Main game screen area, it is written within the editor itself. Make sure Test_Djedu.xml is exact same as the .scn name.
existenz
10-04-2006, 09:21 PM
Sorry should have said TM forum wont accept xml uploads to attach it here so I changed it to a doc file. I did use an xml file for the game. The requests/demands were in the editor last time I looked and I did save - I believe I did anyway!!:D Also the written request did not show up in the Imperial Advisor screen for me. So if my xml file is set up wrong can you look at it and advise. When I played the game the requests came when I had asked them to and for the right amounts, on the win screen it showed the proper ratings needed and attained. I'm getting a bit lost here - might need to wait and see if TM can come out with something to make it slightly easier.( Doesn't need to be too easy as I like a challenge!!):)
Edit: You used an underscore for Test_Djedu.xml, mine is Test Djedu.xml - is that the problem then? My .scn name is Test Djedu so maybe it doesn't accept spaces in xml?
Pi-Xerxes
10-04-2006, 10:20 PM
Can you pleae post it as pure Test_Djedu.txt file? I cannot work with Doc files.
The name is very picky about spaces, notice the scenarios in the campaign. Just being safe...
existenz
10-04-2006, 10:25 PM
Ok here it is.
Pi-Xerxes
10-05-2006, 02:34 AM
OK got it to work, note that your Goals and Request are not set inside Test_Djedu.scn so you will not ever have any goals in this scenario or request unless create them inside the editor. It will display text proper though at the start.
I changed the <TestDjedu> to <Test_Djedu> so it will match and can find it. must be precise. I had to convert the txt back into XML. I also removed the '>=' from inside the Goal display so it is a plain favor of 40 not >=40 and 1000 not 1,000.
You must rename the extension .zip to .xml since the site will not allow xml uploads. Do this using the command DOS prompt. WinXP is a bugger for letting change the real name (end up with .zip.xml which will not run in game though it 'looks' correct). Rename your .scn to match.
Here is pic for proof. I will let you decide if you want the goals and request to be active or not.
existenz
10-05-2006, 03:25 AM
You are right about XP - Winzip says the file you uploaded here is not a valid archive and I cannot open it. By the way, thanks for all your help. It is much appreciated.:) Can you load them separately i.e .scn file and txt file for the xml file so I can at least see any changes you made and see where I am going wrong. Thanks again.
Pi-Xerxes
10-05-2006, 05:16 AM
Here is the .txt . I have not correct your .scn file since it take some time. You want it the same as was in the original Djedu scenario? The I need to set the addtional Goal -attributes for the Ratings Goals which are new to this scenario.
existenz
10-05-2006, 05:19 AM
No thats fine thanks. I can at least start to work out what I did wrong with just the xml file. Thanks again:)
existenz
10-05-2006, 08:38 AM
Sorry I thought I had set the ratings attributes in the .scn file. Anyway cannot get demands to be saved in the editor - certainly cannot type in the message for the demands, whenever I save and exit and go back in to the editor the message header eg: Req_F Timber has disappeared but if I click on empty space within the top field for requests it shows the request. Weird. Thus cannot get the splash screen to show anything. How did you get it to do that? I cannot have copied the xml file properly or something. I might just have to give up and wait for someone to post a tutorial or something. My computer is crashing while putting textures on a default map which I have flattened as much as I can. So am ready to give up.:(
vBulletin® v3.7.2, Copyright ©2000-2013, Jelsoft Enterprises Ltd.