1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Modders Guide to Orbis

Discussion in 'Orbis Modmod' started by Ahwaric, Jul 12, 2009.

  1. Ahwaric

    Ahwaric Shrubbery-hugger

    Joined:
    Nov 12, 2005
    Messages:
    1,217
    Location:
    Kraków, Poland
    It is a high time I start answering some questions here...
    Not that I mind other people doing it ;)

    You need to change iWeight for EVENTTRIGGER_VOLCANO in CIV4EventTriggerInfos.xml
    If you have office 2007 it can easily be done from orbis editor, too.
    The weight is currently set to 100, so not so high. There are just not so many events in early game. I really need to review what events we do have and when do they fire...
    True. There are some functions that are better avoided. Well, too much python is better avoided ;)
    I really need to add a tag for minimum distance between improvements to get rid of that canbuild callback...
     
  2. Pazyryk

    Pazyryk Deity

    Joined:
    Jun 13, 2008
    Messages:
    3,584
    Thanks! I'm not sure that I ever even looked in PythonCallbackDefines.xml. So if I turn on CANNOT_MOVE_INTO_CALLBACK it's going to be a huge performance hit?

    I wish I could handle movement restrictions in a more dynamical way. It's very limiting to only have "passable" and "impassible", with units that either can or can't enter impassible. I know that there is TerrainImpassables and FeatureImpassables in the unit XML, but this doesn't help much because I can't change it in game (e.g., with level prereq, promotion, spell, event, etc.). Actually, I could do everything I want if I could just change TerrainImpassables and FeatureImpassables via promotions (then I could giveth and taketh away the promos for whatever I wanted).
     
  3. Pazyryk

    Pazyryk Deity

    Joined:
    Jun 13, 2008
    Messages:
    3,584
    If I change tile yields using a python command, do I need to do anything (like recalculate areas) to make the AI aware of the changes for the purpose of finding best city locations?

    If it matters, I'm using eTeam.changeImprovementYieldChange to alter a Unique Feature yield for a particular AI player. It seems to work (mousing over the tile shows the new yield). But the yield graphics shown when a settler is selected don't update even after several turns. Also, the "blue circle" city placement suggestions don't seem to update (or maybe they are too stupid to see a 30/30/30 yield tile as a good thing), but I'm not clear if that has anything to do with AI city placement.
     
  4. xienwolf

    xienwolf Deity

    Joined:
    Oct 4, 2007
    Messages:
    10,589
    Location:
    Location! Location!
    To update the icons on the map you need to run .updateSymbols, not sure if that is a map or plot function. You would also need the AI to recalculate their ideal found locations, I am almost certain that the function required to do so is not exposed to python
     
  5. Ahwaric

    Ahwaric Shrubbery-hugger

    Joined:
    Nov 12, 2005
    Messages:
    1,217
    Location:
    Kraków, Poland
    Some quick update here - and I really need to find time to update the first post, too :)

    Next version of Orbis will bring some big changes on the modder side. The most important are:

    1. added functional traits sheet in editor
    2. Spells tags rearranged (including editor and schema files) - I have grouped reladed ones together. The same is planned for promotions & units.
    3. Tags removed:
      • explorable - was influencing exploring units too much so I have not been using it
      • promotionreplacedby - all it added was a nice description, all that it was supposed to do can be done by promotionexcludes
      • pythonondeath - with removing alcinus mechanics, no other unit uses it now. Also, the tag is quite 'persistent' regarding when to fire so I have decided to remove it if not needed

    So, in general, the changes are big and updating can be hard as some things will have to be manually rewriten.
    To make things brighter, if you have any complains, let me know.
    Also, if there is a tag that would make you happy if existed in Orbis, please let me know. I do not promise anything, but will see what can be done.
     
  6. Opera

    Opera Deity

    Joined:
    Sep 21, 2008
    Messages:
    4,643
    The onCombatVictoryYields or something similar that you can find in FF ;)
     
  7. civ_king

    civ_king Deus Caritas Est

    Joined:
    Mar 9, 2006
    Messages:
    16,368
    I could make some buildings in SketchUp?
     
  8. Opera

    Opera Deity

    Joined:
    Sep 21, 2008
    Messages:
    4,643
    Ahwaric, could I request some tags from FF? I may import them myself but, well...

    Two promotion tags: NewName and bStackEffect.

    Also, the commander system would be nice. I looked into it but I'm not sure how it works yet... I'll wait till I grasp it more to see if I'm able to import it.
     
  9. Ahwaric

    Ahwaric Shrubbery-hugger

    Joined:
    Nov 12, 2005
    Messages:
    1,217
    Location:
    Kraków, Poland
    It is easier to ask :p
    I can always use your code after you improt them ;)
    Well, I have already tried with newname - and did not succeed. But maybe this time... will see.
    Stack effect - another tag that scares me.
    Will see what I can do (time, more time please ;) ). I remeber of the yields from kills, too. But that one has to be rewritten to suit your needs.
    Says the woman that said "Orbis needs more original stuff and less imports" :p

    Sorry, just beying playful today. Sun and all that nice weather circumstances...
     
  10. Opera

    Opera Deity

    Joined:
    Sep 21, 2008
    Messages:
    4,643
    You're picking on me! Like everyone else! :lol:

    Anyway, I'm willing to write an all new and shiny "commander system" but I don't know where to start, what we want and if I would have time & energy for it... I just know I could use FF's one (or HoTK's one, more complex) for the Ngomele's Kha.
     
  11. WilliamOfOrange

    WilliamOfOrange King

    Joined:
    Jul 17, 2003
    Messages:
    998
    Location:
    Lincolnshire, UK
    I have a question about adding units. Opera has been very helpful in answering my questions, but I thought I would share my problem in case others have seen and also need help or they can help me.

    I have added one unit to the Orbis editor and this is the error message that I get. has anyone seen this?
     

    Attached Files:

  12. Ahwaric

    Ahwaric Shrubbery-hugger

    Joined:
    Nov 12, 2005
    Messages:
    1,217
    Location:
    Kraków, Poland
    Looks like tags are in wrong order - in unitinfo the order is different than in schema file.
    Schema seems fine, but I will have to test it.

    Could you share the file please? It will help me with debuging if I can use it.
     
  13. WilliamOfOrange

    WilliamOfOrange King

    Joined:
    Jul 17, 2003
    Messages:
    998
    Location:
    Lincolnshire, UK
    Yeah, and the weird thing is that even if you add the unit not at the end of the units in the xlsm file, it still happens. You'll have to create an entry in the UnitClassInfos to match the one I added. Here it is.
     
  14. Ahwaric

    Ahwaric Shrubbery-hugger

    Joined:
    Nov 12, 2005
    Messages:
    1,217
    Location:
    Kraków, Poland
    Sorry for the delay, I had little time...

    But found it. You did not add -1 in iMinAreaSize for the new unit. Fields with -1 as default value have to be filled.
    Fortunately it is easy to fix :)
    It is one of the few tags that are still required. On the other hand, you can get rid of all fields with just 0 inserted - it will be added by schema file anyway.
     
  15. WilliamOfOrange

    WilliamOfOrange King

    Joined:
    Jul 17, 2003
    Messages:
    998
    Location:
    Lincolnshire, UK
    Brilliant! I thought I had put that one in there. All the zeroes were part of my test. Thank you very much.
     
  16. WilliamOfOrange

    WilliamOfOrange King

    Joined:
    Jul 17, 2003
    Messages:
    998
    Location:
    Lincolnshire, UK
    New Question here:

    I have been adding some "spells" such as Land and Take Off to units with a Ability to Fly promotion. The spell for Take Off adds the Flying promotion and removed a Landed Promotion. I have the Landing spell do the opposite. Everything works great! I noticed that The unit could still land on water terrain (as I gave the water walking ability to the flying promotion as well..or maybe it was already there?).

    I tried to make a promotion called Above the Water that the unit gains when it is flying over Coast and Ocean tiles and which blocks the Land spell. I also have divised some spells and promotions which work for a unit with the On Water promotion that I added so that a unit can Dive underwater or Swim back to the surface.

    Now, here is the problem. Everything works fine in the editor with the spells, when I give the unit the promotion needed, such as Above the Water or On Water. For some reason, the units are not auto-acquiring the promotions they need. I have modelled those promotions the same as Forest Stealth, except that they do not turn invisible and instead of requiring Forest or Jungle Features, they need Coast or Ocean Terrain.

    Could someone else try this and see if it works, because I have fiddled around with things and can't find the error. I have checked spelling, and other silly errors, and redone it once or twice, but I can't seem to get it to recognize it's on a water tile and adopt the promotion like the Forest Stealth works. Any ideas?

    Thanks.
     
  17. xienwolf

    xienwolf Deity

    Joined:
    Oct 4, 2007
    Messages:
    10,589
    Location:
    Location! Location!
    You aren't using the Forest Stealth too closely are you? Forest = feature. Ocean = terrain.

    Also ensure that the promotion works without any terrain required first. That checks things like Unitcombat and minlevel for you. Both easily forgotten
     
  18. WilliamOfOrange

    WilliamOfOrange King

    Joined:
    Jul 17, 2003
    Messages:
    998
    Location:
    Lincolnshire, UK
    I do have the ocean in the terrain part. I will try testing it without the terrain prereq....good idea. Does UNITCOMBAT need to be stated? Also, I haven't used the minlevel for a lot of the promotions that I have added. I have seen that some use it and some don't. I certainly could use it to help ensure only certain units will use it, but does it really matter?
     
  19. xienwolf

    xienwolf Deity

    Joined:
    Oct 4, 2007
    Messages:
    10,589
    Location:
    Location! Location!
  20. WilliamOfOrange

    WilliamOfOrange King

    Joined:
    Jul 17, 2003
    Messages:
    998
    Location:
    Lincolnshire, UK
    Turns out that I did have the unitcombats set and did not have the min level at -1. I wrote the question at work and didn't have the file in front of me.I tested without the terrain prereq and still nothing. I will try again on the weekend. Thanks for you help though. :goodjob:

    EDIT: I've figured it out. I have bValidate set to 1. It's weird because another spell I added didn't work without it, but I noticed that Forest Stealth didn't have it. Works now.
     

Share This Page