Announcement

Collapse
No announcement yet.

One for u slic experts!

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

  • One for u slic experts!

    Can anyone help with a Q on Disseminate.slc

    Playing CTP again with the Med mod and I have realised that the slic code that grants players a possible free advance under certain conditions often gives you one way way ahead of your tech tree ie the leader ai's highest tech

    I think it would work more fairly by simply granting you the current tech advance u are researching.

    That way it gives you the leg up u often need but at the same time doesn't give you an advance too far ahead.

    I would like to adjust this in the code and am guessing I would mainly just need the string value for what the currently researched item for BOTH the player/Ai would be called.

    anyone help or adjust the code for me

    remember I want it to grant the currently researched tech when triggered for the players/ai

    code attached (its not long)
    Attached Files
    ---------------------------------------------
    Pavlov Zangalis - Hero of the capture of Berlin RFDG.
    ---------------------------------------------

  • #2
    Well, this is a Civ:CtP (aka CTP1) SLIC file and I can't tell you if the answer to your question in the appropriate forum is correct for the old version of SLIC.

    In CTP2 player.researching contains a string and won't be of much use. To get the index of the advance the player is currently researching you could try the functions GetNextAdvance or maybe GetProjectedScience . These functions are not really explained in our documentation and obviously noone has reportedly tested them before. Also, I don't know if they already existed in CTP1 -- but anyways if you are interested in modding you would possibly be even more interested in modding CTP2 (Apolyton Edition), which offers more and better modding possibilities than CTP1 .

    However -- if you manage to figure out the database-index of the advance the player is currently resarching you may use the GrantAdvance function or the GrantAdvance event to do what it says . Obviously GrantAdvance is already available in CTP1.
    The modding knowledgebase: CTP2 Bureau (with CTP2 AE Modding Wiki). Modern Times Mod (work in progress): MoT-Mod for CTP2.

    Comment


    • #3
      database of advances in .slc file attached

      thanks sorta follow what your saying but i'm no coder really using the .slc file I provided what strings should I replace with perhaps getnextadvance.

      sorry need a lot more help as i really don't understand the source slic much as it seems to have triggers for multiple events ie discovery traded, discovery type not sure which is the string that grants the advance

      if you could clearly point out the parts where I need to replace the string with the ctp1 version of getnextadvance that will help

      looking at the code i'm thinking discovery.type X and discovery.traded X is the particualr advance so rather than giving

      GrantAdvance(playerIndex, discovery.type or discovery.traded) it needs to be
      GrantAdvance(playerIndex, getnextadvance) or whatever getnextadvance works for ctp1

      ???
      Last edited by Colwyn; May 18, 2006, 23:53.
      ---------------------------------------------
      Pavlov Zangalis - Hero of the capture of Berlin RFDG.
      ---------------------------------------------

      Comment


      • #4
        I did a brief lookup in the old function reference -- obviously GetNextAdvance and GetProjectedScience are not available in SLIC 1.2. Though it would still be interesting to eventually test these functions in CTP2, the only way to go in CTP1 seems to be trying the player.researching variable. This will only work if hatschy's info concerning the type of this variable (integer, database index) is correct.
        In this case you could try what hatschy already suggests (though I am not familiar with this messageboxes-substituting-functions-technique in the old SLIC ).
        If this gives you a SLIC error or crashes the game it's most likely due to the player.resarching variable being a string instead of an integer (database index) -- we know it's a string in CTP2, but maybe they have changed this from CTP1 to CTP2 . That's what I wanted to point out in my first message.
        The modding knowledgebase: CTP2 Bureau (with CTP2 AE Modding Wiki). Modern Times Mod (work in progress): MoT-Mod for CTP2.

        Comment

        Working...
        X