Advertisement
Civilization Fanatics' Center  

Go Back   Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization > Civ4 - SDK/Python

Reply
 
Thread Tools
Old Sep 08, 2011, 04:42 PM   #1
keldath
LivE LonG AnD PrOsPeR
 
keldath's Avatar
 
Join Date: Dec 2005
Location: israel
Posts: 5,490
aggressive animals + enter to cultural borders?

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?
__________________
keldath is offline   Reply With Quote
Old Sep 08, 2011, 06:26 PM   #2
TheLadiesOgre
Aspiring Codesmith
 
TheLadiesOgre's Avatar
 
Join Date: Jan 2009
Posts: 504
LunarMongoose did this, they'll also capture your cities too

The discussion thread that details all of the changes is here
__________________
PerfectWorld2.03_WithMarshes
TLOTags: New Promotions all editable from the XML

**Life is Good, updates forthcoming... please be patient though**
TheLadiesOgre is offline   Reply With Quote
Old Sep 08, 2011, 09:40 PM   #3
Baldyr
"Hit It"
 
Baldyr's Avatar
 
Join Date: Dec 2009
Location: Sweden
Posts: 5,530
Isn't it sufficient just to not flag those units as "animals"? Then they behave just like any (barbarian) unit.
__________________
How to Make a Python Mod - Python modding tutorial
CivIV Python Class Reference - modding Python API
How to Think Like a Computer Scientist - online Python textbook
CivPlayer - Python scripting tool
Spoiler:
Q: Who is the woman in the avatar image?
A: Miss Li.
Q: Why does she have a brass-eye?
A: It's a conceptual thing. More of the same on the profile page.

Q: What does you title mean?
A: That is the title of Miss Li's latest single.
Baldyr is offline   Reply With Quote
Old Sep 09, 2011, 03:32 AM   #4
keldath
LivE LonG AnD PrOsPeR
 
keldath's Avatar
 
Join Date: Dec 2005
Location: israel
Posts: 5,490
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.
__________________
keldath is offline   Reply With Quote
Old Sep 09, 2011, 09:46 AM   #5
Baldyr
"Hit It"
 
Baldyr's Avatar
 
Join Date: Dec 2009
Location: Sweden
Posts: 5,530
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]

		if gc.getUnitInfo(unit.getUnitType()).isAnimal():
			unit.setUnitAIType(UnitAITypes.UNITAI_ATTACK)
__________________
How to Make a Python Mod - Python modding tutorial
CivIV Python Class Reference - modding Python API
How to Think Like a Computer Scientist - online Python textbook
CivPlayer - Python scripting tool
Spoiler:
Q: Who is the woman in the avatar image?
A: Miss Li.
Q: Why does she have a brass-eye?
A: It's a conceptual thing. More of the same on the profile page.

Q: What does you title mean?
A: That is the title of Miss Li's latest single.

Last edited by Baldyr; Sep 09, 2011 at 09:56 AM.
Baldyr is offline   Reply With Quote
Old Sep 09, 2011, 11:04 AM   #6
The_J
Say No 2 Net Validations
 
The_J's Avatar
 
Join Date: Oct 2008
Location: Germany / Netherlands
Posts: 28,941
I thought so too, but that doesn't work in my own mod :/ (but really no idea why ).
__________________
Civ4-BtS-Mod "Mars, Now!"


Steam eats the souls of little gamers!!!
The_J is offline   Reply With Quote
Old Sep 09, 2011, 11:09 AM   #7
Baldyr
"Hit It"
 
Baldyr's Avatar
 
Join Date: Dec 2009
Location: Sweden
Posts: 5,530
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.
__________________
How to Make a Python Mod - Python modding tutorial
CivIV Python Class Reference - modding Python API
How to Think Like a Computer Scientist - online Python textbook
CivPlayer - Python scripting tool
Spoiler:
Q: Who is the woman in the avatar image?
A: Miss Li.
Q: Why does she have a brass-eye?
A: It's a conceptual thing. More of the same on the profile page.

Q: What does you title mean?
A: That is the title of Miss Li's latest single.
Baldyr is offline   Reply With Quote
Old Sep 09, 2011, 11:21 AM   #8
The_J
Say No 2 Net Validations
 
The_J's Avatar
 
Join Date: Oct 2008
Location: Germany / Netherlands
Posts: 28,941
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.
__________________
Civ4-BtS-Mod "Mars, Now!"


Steam eats the souls of little gamers!!!
The_J is offline   Reply With Quote
Old Sep 09, 2011, 11:37 AM   #9
keldath
LivE LonG AnD PrOsPeR
 
keldath's Avatar
 
Join Date: Dec 2005
Location: israel
Posts: 5,490
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.
__________________
keldath is offline   Reply With Quote
Old Sep 09, 2011, 01:21 PM   #10
TheLadiesOgre
Aspiring Codesmith
 
TheLadiesOgre's Avatar
 
Join Date: Jan 2009
Posts: 504
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)
__________________
PerfectWorld2.03_WithMarshes
TLOTags: New Promotions all editable from the XML

**Life is Good, updates forthcoming... please be patient though**
TheLadiesOgre is offline   Reply With Quote
Old Sep 09, 2011, 02:42 PM   #11
keldath
LivE LonG AnD PrOsPeR
 
keldath's Avatar
 
Join Date: Dec 2005
Location: israel
Posts: 5,490
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.
__________________
keldath is offline   Reply With Quote
Old Sep 09, 2011, 04:15 PM   #12
TheLadiesOgre
Aspiring Codesmith
 
TheLadiesOgre's Avatar
 
Join Date: Jan 2009
Posts: 504
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.....
__________________
PerfectWorld2.03_WithMarshes
TLOTags: New Promotions all editable from the XML

**Life is Good, updates forthcoming... please be patient though**
TheLadiesOgre is offline   Reply With Quote
Old Sep 10, 2011, 05:55 AM   #13
keldath
LivE LonG AnD PrOsPeR
 
keldath's Avatar
 
Join Date: Dec 2005
Location: israel
Posts: 5,490
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?
__________________
keldath is offline   Reply With Quote
Reply

Bookmarks

Go Back Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization > Civ4 - SDK/Python > aggressive animals + enter to cultural borders?

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Advertisement

All times are GMT -6. The time now is 03:36 AM.


Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
This site is copyright Civilization Fanatics' Center.
Support CFC: Amazon.com | Amazon UK | Amazon DE | Amazon CA | Amazon FR