1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

aggressive animals + enter to cultural borders?

Discussion in 'Civ4 - SDK/Python' started by keldath, Sep 8, 2011.

  1. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,134
    Location:
    israel
    hi,

    this is probably the wrong forum,

    if so, im sorry.

    i was hoping some1 could help me make animals be more aggressive and to be able to cross into cultural borders as the barbarians does.

    any1 can help me plz?
     
  2. TheLadiesOgre

    TheLadiesOgre Aspiring Codesmith

    Joined:
    Jan 16, 2009
    Messages:
    505
    LunarMongoose did this, they'll also capture your cities too

    The discussion thread that details all of the changes is here
     
  3. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    Isn't it sufficient just to not flag those units as "animals"? Then they behave just like any (barbarian) unit.
     
  4. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,134
    Location:
    israel
    TheLadiesOgre,

    great ill check it out, thank you!

    great to see your active here again.


    Baldyr,
    hi my friend,
    i thought so too, but it didnt help..

    ty.
     
  5. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    Well, I do believe it would be possible to catch any animal units created with a Python call-up and have a script manually change the UnitAIType. Because changing it from UnitAIType.UNITAI_ANIMAL to something else than the default setting should do the trick.
    Spoiler :
    CvEventManager.py:
    Code:
    	def onUnitCreated(self, argsList):
    		'Unit Completed'
    		unit = argsList[0]
    
    [COLOR="Red"]		if gc.getUnitInfo(unit.getUnitType()).isAnimal():
    			unit.setUnitAIType(UnitAITypes.UNITAI_ATTACK)[/COLOR]
     
  6. The_J

    The_J Say No 2 Net Validations Retired Moderator

    Joined:
    Oct 22, 2008
    Messages:
    29,758
    Location:
    Germany / Netherlands
    I thought so too, but that doesn't work in my own mod :/ (but really no idea why :dunno:).
     
  7. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    What about it doesn't work? I know its possible to change the UnitAIType, and if I give UNITAI_ANIMAL to any unit, it will act like an animal unit. So I'd expect the opposite to be true, also. But I guess not, then. :dunno:
     
  8. The_J

    The_J Say No 2 Net Validations Retired Moderator

    Joined:
    Oct 22, 2008
    Messages:
    29,758
    Location:
    Germany / Netherlands
    They don't behave like it. To ensure that "animals" also appear later in my mod, every turn later on some are spawned, but with the attack AI. They can't enter the civs territory, at least that's what i currently remember.
    Might be worth again a try to find out what exactly might be needed to change there.
     
  9. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,134
    Location:
    israel
    hey guys,

    well i extracted the mongoose sdk codes,
    it seems to work, animals do get into culture borders and attack units inside.

    so far so good.

    thank you all friends.
     
  10. TheLadiesOgre

    TheLadiesOgre Aspiring Codesmith

    Joined:
    Jan 16, 2009
    Messages:
    505
    Glad to hear it worked out for you keldath, I used the same code for my own personal mod (wholly unreleased, done more as a learning thing way back)

    IIRC, I changed it so that they wouldn't enter cities, it makes sense that they would kill an early settlement, but I just found it so annoying (<-IMHO, probably cause I like to wait a little before training combat units for city defense)
     
  11. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,134
    Location:
    israel
    ahh nice, ah new mod from you,

    thats good news!

    well - i saw the result of the animals, i used in in two dlls i have,
    with one it worked with the other - i did a quick test and didnt see animals get in borders,
    but i think i need to give those animals a unitai attack, which i did in my first test.
     
  12. TheLadiesOgre

    TheLadiesOgre Aspiring Codesmith

    Joined:
    Jan 16, 2009
    Messages:
    505
    While I am updating my mod, I never released the one I added the animal code from....

    It was part of the first mod I did, I only did it for me and I never released it

    I couldn't release it now even if I wanted to, I lost it 3 computers ago.....
     
  13. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,134
    Location:
    israel
    ahh i see,

    oh well.

    maybe you can write he the code so i can put it in my mod?

    **********
    on another note -
    can some1 help and write a code for me that spawns either barberians and more importantly animals within cultural borders?
     

Share This Page