Animal Placement

@StrategyOnly, RoM is WoC/BUG modular so you should try and make your mods likewise:mischief:. The main reason for doing it that way is that it reduces the likelihood of other mods breaking yours by overwriting your XML, for example AND:rolleyes: Yes, I do know that some XML isn't WoC-able but I don't think any of these are.

Since this does something which I maybe able to pinch to expand the Subdue Animals mod I will have a look at making this fit RoM in a modular form. Who knows it may then be usable in other mods :).

Also you only give workers the ability what about the future workers (clones et al) in RoM plus the undead worker in AAranda's religions? Should they be able to make these as well?
 
@StrategyOnly, RoM is WoC/BUG modular so you should try and make your mods likewise:mischief:. The main reason for doing it that way is that it reduces the likelihood of other mods breaking yours by overwriting your XML, for example AND:rolleyes: Yes, I do know that some XML isn't WoC-able but I don't think any of these are.

Since this does something which I maybe able to pinch to expand the Subdue Animals mod I will have a look at making this fit RoM in a modular form. Who knows it may then be usable in other mods :).

Also you only give workers the ability what about the future workers (clones et al) in RoM plus the undead worker in AAranda's religions? Should they be able to make these as well?

Yeah i thought about the clones etc and i was just going to test it before, but it does sound reasonable to put that knowledge with the clones etc.

But as far as making it a modular, DEFINITELY have at it, i just dont get that BUG/REV stuff that much, and i do know your alot better than i am at that stuff, so by all means PLEASE do it, and thx.;)
 
I think the main problem you are having with it at the moment is because the CvGameUtils.py in RoM is totally different to the one in your mod. I am trying to figure out where the canBuild function should be. The rest is progressing quite quickly.
 
the worker stands on a tile without road. it means this tile doesn't have access to the resource - just like a city without a road connection.
 
the worker stands on a tile without road. it means this tile doesn't have access to the resource - just like a city without a road connection.

Thats not what i was getting to, before there were horses/sheep etc in the worker area?
 
@StrategyOnly & NotSoGood, Attached is my work on this so far. It is almost fully WocBUG modular but I am getting a Python error I can't figure out in the callback code. I have been looking at it for three days so thought a fresh pair (or two) of eyes my help.

Installation:-
1. Edit init.xml and add <load mod=AnimalPlacing"/>
2. Edit Assets/XML/PythonCallbackDefines.xml and change USE_CAN_BUILD_CALLBACK tag to 1.

Note. the RoM PythonCallbackDefines is different to the AND one so I did not include the file here.
 
Okay, I looked at your python code and I think it should work. One thing that I think should be there too is the class and the eventhandlers. I'm not a python expert so I'll have to do some more searching to find the problem, but what is the error you're getting? It might help to spot it.

EDIT: I haven't modded BUG ever so all this is pretty much quessing, but by following the BUG modding tutorial I can see you haven't added the AnimalPlacing to init.xml which loads your python. Also seems that the class isn't required. But I think improvementBuilt in AnimalPlacing.xml should start with a capital letter (ImprovementBuilt).
 
Okay, I looked at your python code and I think it should work. One thing that I think should be there too is the class and the eventhandlers. I'm not a python expert so I'll have to do some more searching to find the problem, but what is the error you're getting? It might help to spot it.

The error I am getting is with the cyMap function in the call back. The rest seems to work. With the latest BUG stuff you do not need event handlers or classes.

EDIT: I haven't modded BUG ever so all this is pretty much quessing, but by following the BUG modding tutorial I can see you haven't added the AnimalPlacing to init.xml which loads your python. Also seems that the class isn't required. But I think improvementBuilt in AnimalPlacing.xml should start with a capital letter (ImprovementBuilt).

Definatelly not I but i we figured that out in the Militia mod :).
 
I dont have any action button(s) with the one you posted in 27? For some reason my BUG is not reading ANY of the Config stuff, just like the slaves one:mad:



EDIT: So i tried it this time with the <load mod="AnimalPlacing"/>: and got this? But still no action btns.

Traceback (most recent call last):
File "BugEventManager", line 361, in _handleDefaultEvent
File "AnimalPlacing", line 50, in onImprovementBuilt
NameError: global name 'PyInfo' is not defined
 
Argh :mad: , that was one nasty error. It was a typo. In canBuild:
Code:
def canBuild(argsList):
	iX, iY, iBuild, iPlayer = argsList
	# NotSoGood start
	plot = CyMap.plot(iX, iY)
...
I forgot () after CyMap. :cry:

I hope that fixes it...
 
@StrategyOnly & NotSoGood, Attached is my work on this so far. It is almost fully WocBUG modular but I am getting a Python error I can't figure out in the callback code. I have been looking at it for three days so thought a fresh pair (or two) of eyes my help.

Installation:-
1. Edit init.xml and add <load mod=AnimalPlacing"/>
2. Edit Assets/XML/PythonCallbackDefines.xml and change USE_CAN_BUILD_CALLBACK tag to 1.

Note. the RoM PythonCallbackDefines is different to the AND one so I did not include the file here.

Argh :mad: , that was one nasty error. It was a typo. In canBuild:
Code:
def canBuild(argsList):
	iX, iY, iBuild, iPlayer = argsList
	# NotSoGood start
	plot = CyMap.plot(iX, iY)
...
I forgot () after CyMap. :cry:

I hope that fixes it...

Even after that i still get nothing in Dancing H's worker??:(
 
Even after that i still get nothing in Dancing H's worker??:(

why should you? you don't have access to any animal resource.

the plot you want to place an animal resource must have a road connection the resource of that type (which must be under your control ofc).
 
You don't seem to have any animals yet. It was designed to allow you to "build" animals only after you already have them. Try WBing yourself a horse and a pasture with road.

why should you? you don't have access to any animal resource.

the plot you want to place an animal resource must have a road connection the resource of that type (which must be under your control ofc).

OK, i made a road and a pasture for both sheep and horses, still, NOTHING?
 
@StrategyOnly & NotSoGood, I agree it is not working. My latest version is attached.

Installation:-
1. Edit init.xml and add <load mod=AnimalPlacing"/>
2. Edit Assets/XML/PythonCallbackDefines.xml and change USE_CAN_BUILD_CALLBACK tag to 1.

Note. the RoM PythonCallbackDefines is different to the AND one so I did not include the file here.
 
OK when i just downloaded the above i now get this error(s):

Spoiler :
Traceback (most recent call last):
File "BugConfig", line 78, in parse
File "e:/main/civilization4/warlords/assets/python/system\xmllib.py", line 175, in close
File "e:/main/civilization4/warlords/assets/python/system\xmllib.py", line 408, in goahead
File "BugConfig", line 122, in syntax_error
ConfigError: error parsing configuration: bogus `<'
Traceback (most recent call last):

File "BugUtil", line 691, in <lambda>

File "BugEventManager", line 569, in preGameStart

File "BugEventManager", line 338, in fireEvent

File "BugEventManager", line 348, in _dispatchEvent

File "BugEventManager", line 408, in _handleInitBugEvent

File "BugInit", line 43, in init

File "BugInit", line 64, in loadMod

File "BugConfig", line 78, in parse

File "e:/main/civilization4/warlords/assets/python/system\xmllib.py", line 175, in close

File "e:/main/civilization4/warlords/assets/python/system\xmllib.py", line 408, in goahead

File "BugConfig", line 122, in syntax_error

ConfigError: error parsing configuration: bogus `<'
ERR: Python function preGameStart failed, module CvAppInterface
 
Back
Top Bottom