Announcement

Collapse
No announcement yet.

Need some help with slic!!!!!!!!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Need some help with slic!!!!!!!!

    Hi guys, I have a question about slic. Please bear with me and forgive me because I have limited programming experience and slic seems to be somewhat confusing for me. My question is about message boxes. For example

    text(ID_this_is_whack);

    would this point to a flag in info_str.txt called this_is_whack? Is that the file you call the text from. Also I noticed in tp powerslic he has a file called ps_info.txt where all his text for his message boxes is kept. He also has for example: Title_bla_bla and then below it would say for example: text_bla_bla. Is the Title_bla_bla for adding titles for to a message box or am I getting off base. It doesn't say anything about that in the slic documentation. Also since TP used his own filename for his text can I just use something like Gemini_info.txt. Would that work or do I have to somehow define in the slic script which filename I am using for all the message text. Can someone point me in the right direction. Again please forgive me but I'm trying to remember how to program again. And I hope I haven't confused anyone too much. ;-)

    ------------------
    Gemini

  • #2
    In your ctp_data\english\gamedata directory there is a file called strings.txt. In this file all strings files are imported. You can add your own strings file by adding a line to strings.txt that would say import myfile.txt (replace with your filename). In your slic scripts you can call strings that are in any of the files that are imported in strings.txt.

    Comment


    • #3
      Gemini,

      It is best to put your code in your own files. For the SLIC code, use gemini.slc and put in (CTP)\ctp_data\default\gamedata. Then edit script.slc (in same directory) and put #include "gemini.slc" at the bottom of the file.

      For your strings, make gemini_str.txt and put in (CTP)\ctp_data\english\gamedata. Then edit strings.txt (in same directory) and put import "gemini_str.txt" at the top of the file.

      You are correct. Text(ID_This_Is_Text_A) is the text for the messagebox and Title(ID_This_Is_Text_B) is the title for the messagebox. Both of these display the text pointed to by the string ID, This_Is_Text_A or This_Is_Text_B. String IDs are always preceeded by ID_. All you have to know is to put ID_ before the name of the message you used in your gemini_str.txt file when you make the call. Buttons are string IDs also. For example:

      Gemini.slc: code would look like,
      Text(ID_This_Is_Text_A);
      Title(ID_This_Is_Text_B);
      Button(ID_Name_On_Button);

      Gemini_str.txt: message would look like,
      This_Is_Text_A "This is what displays in the text area."
      This_Is_Text_B "This is what displays in the title area."
      Name_On_Button "This is what displays on the button."

      To show values in a message, use the built-in variable (ie, city.name) or the user defined global variable (ie, gv_population) with .value attached to it. For example:

      Shows_Variable_Data "The population of [city.name] is [gv_population.value]."

      Hope this helps and you can understand it. If not, let me know.

      BTW, the SLIC docs is still being worked on. I ran into some problems which caused me to push back the release. Should be soon though.



      ------------------
      Don, Apolyton Junkie

      Don,
      CtPMaps (Hosted by Apolyton)

      Comment


      • #4
        Thank you so much Paul and Skorpion59. I completely understand now. Thank you also for the quick response!!!!!

        ------------------
        Gemini

        Comment

        Working...
        X