Sorry.. Private msg to Requies, Bhruic, 12monkeys,

SimCutie

Warlord
Joined
Dec 10, 2005
Messages
197
This is personal message to Requies, Bhruic, 12monkeys..
I should have used PM or E-mail, but I can not attach ZIP file in PM and
I don't know their E-mail address. ( can not send e-mail thru CivFanatics)

Dear, Requies, Bhruic, 12monkeys.
You great modders... I love your mod's and I like to say thank you.
You may not know me.. But I am some little modder, too.
So.. May I ask a favor of you?

I have some mod file that I have developed for Civ4 modding community over last holydays.
It is kind of generic Event handler / input handler and Profile manager
I'd like to ask you, best experts on Civ4 modding, to test my file and give me comment,
advice or guidance, please.

This is not intended for general public release.. Just very early alpha stage..
This is quite early stage of development so it is far from complete and maybe full of bug.
And no documentation to name of. Just snapshot of current CustomAssets folder contents..
Just make sure backup your "My Documents/My Games/Sid Meier's Civilization 4/CivilizationIV.ini"

Thoses who are interested ( and brave enough to take the risk :) ) may test and comment it, too.

Thanks in adavnce..
 

Attachments

I'd probably need more of an idea of exactly what you are trying to accomplish with your mod. Just "test this" isn't very specific.

Bh
 
It is not mod for end user or player. It is kind of libray and framwork for mod developer.
Inspired by Impaler's Fully Extended CvCustomEventManager
I wrote a truely auto/self-configuring EventManager and ScreenInput manager.

You don't have to edit any line of CvEventManager.py to add custom event handler to your mod.
This CvEventManager will search Custom mods and register custom event handelr for you.
And for Input handler, you dont have to edit CvScreenUtils.py to add your screen to redirect input event to your screen.
Just call screen register routine in CvScreenUtils.py on initialization time
( normally YourScreenClass.__init__() time, and you will get keyboard or mouse event.
It will enhence intraoperability of mutiple mods which modifies CvEventmanager/CvScreenUtils...

There is custom Option screen,too.
Now, you can add custom option screen widget to existing game option screen
(on menu screen or activated by Control-O in game),
and your mod can easily save player's game settings about your mod.
There are few library module for Civ4 Python mod writer in "custom" folder.

I also added mod I have made sometime ago (SimCutie's Improved Mainscreen mod" )
to demonstrate how to use the new Custom Option facility and libray.
And I modified Great People Mod (picture data not included) , 12Monkey's ReInitinterceptorMission Mod
and Plot line button enhencement Mod. I modified them to use my libray to test libraries
and included as technical demonstration.

I plan to develop and release them as Civ4 moder's common library.
But, to do so, I need a lot of feedback and criticism from many more experinced modders like you.
Try to use them in your mod python file and give me feedback.
What feature or function you want to add? Are they helpful and convinent for general modder
to use the library and framework? and please report me bugs of the libraries.
 
SimCutie said:
It is not mod for end user or player. It is kind of libray and framwork for mod developer.
Inspired by Impaler's Fully Extended CvCustomEventManager
I wrote a truely auto/self-configuring EventManager and ScreenInput manager.

You don't have to edit any line of CvEventManager.py to add custom event handler to your mod.
This CvEventManager will search Custom mods and register custom event handelr for you.
And for Input handler, you dont have to edit CvScreenUtils.py to add your screen to redirect input event to your screen.
Just call screen register routine in CvScreenUtils.py on initialization time
( normally YourScreenClass.__init__() time, and you will get keyboard or mouse event.
It will enhence intraoperability of mutiple mods which modifies CvEventmanager/CvScreenUtils...

There is custom Option screen,too.
Now, you can add custom option screen widget to existing game option screen
(on menu screen or activated by Control-O in game),
and your mod can easily save player's game settings about your mod.
There are few library module for Civ4 Python mod writer in "custom" folder.

I also added mod I have made sometime ago (SimCutie's Improved Mainscreen mod" )
to demonstrate how to use the new Custom Option facility and libray.
And I modified Great People Mod (picture data not included) , 12Monkey's ReInitinterceptorMission Mod
and Plot line button enhencement Mod. I modified them to use my libray to test libraries
and included as technical demonstration.

I plan to develop and release them as Civ4 moder's common library.
But, to do so, I need a lot of feedback and criticism from many more experinced modders like you.
Try to use them in your mod python file and give me feedback.
What feature or function you want to add? Are they helpful and convinent for general modder
to use the library and framework? and please report me bugs of the libraries.

Ok, I was at the same stage as Bhruic, but he was smart enough to ask what you meant :lol: .

I'll try to take a look at it.

Interesting idea.

Req
 
OK, I had a first glance on it. I'm not sure if I understood all of your code, because it's bit of complex for a quick view, so let me repeat some things with my own words :


Eventhandler :
--------------------
your modified event manager does automatically grab all custom events, as long as there is a function EventHandlerSetup() in the mod, which needs to be programmed according to your specs. If this is the case, then there is no longer need to modify the CvEventManager().
This is a much more clean than the CustomEventManager solution, which simply moves the problem to another file.

Questions / Suggestions :
- is it possible to define a hierachie on events. There may be the need, that I have multiple function on one event, and I want to process them in a specific order. Is there a way?

Remarks :
you wrote that Mouse Button Down are not working in any function (sorry forget the name). I saw, that have it nested into the Mouse Click Event. Could it be, that the Button Downs events are only working outside the Mouse Click event? (Just a guess, I'm not even sure if I understood the problem!)

Bugs :
- you used a fixed path for "my documents/my games/...." path (again, I fogot the name of the file). This path varies depending on the localized installation. On my PC there is no such a path, so I had to change it in the code. Maybe there is way to retrieve this path it from OS environment or from the Civ INI file? Anyway, nothing serious.


Custom Options :
---------------------
Apart from the fact that is a good idea to use that option screen for mod configuring, I'm not sure about your modification. Is there a similar "modular" concept as for the events? As I analyzed it, all option screen modifications must be within the file "CvCustomOptions.py". If so, we have the same problem again, that people have to merge source code.
Isn't there a similar modular concept possible as you implement it for the events???


Resumee :
---------------------
Finally I think that you did a really good job. Especially the event handler concept is very good, I really like it. The Custom Options is a good idea, but its needs to be as similar modular as the events manager to be really useful for a framework.

However : great piece of work! You don't need to hide it here, publish it!


PS : btw, their is a funny typo in CvEventManager.py line 381 :
:D :D :D ... You should check ****-control-alt ... :D :D :D

PPS : how did you manage to open that private thread here?

PPPS : thx for cleaning up my plot list code ;)
 
Sorry for butting in on a private thread (I guess I cant resist temptation to see new code). Glad to hear that Extended CustomEventManager has inspired you to make your obviosly much more sophisticated and over my head improvments. If this all works out as well as it looks that it will then merging python event triggered Mods will become even easier, possibly to the point that ModSwitcher could do it reliably.

As 12 Monkeys points out the order that moduals are called is going to be tricky, their are always going to be potentials for imcompatabilities in Mods which can only be resolved by manualy merging the code. Most of the time executing them in the right order would give us the desired results but that order is going to need to be specified by the Modual. Three types spring to mind, moduals that should execute before normal event handling, instead of it and after the normal event. We will have to assume that execution order within each of these groups is irrelivent for now. I think only one Modual that over-rides normal event handling should be allowed or else odd things could happen, an Error being generated if the game loads with more then one such modual.

Also I sugjest you continue to use a wraper around the Original EventManager simply to protect your Mod from future Patches/Expantion packs which might alter or add Events. Speaking of adding Events, I suspect people will want to Mod in new Event triggers such as "onChangeCivics", some though should go towards making this as hastle free as possible.

Good luck with your Mod, these kind of core code improvments ultimatly turn out the be the foundation uponwhich the best Mods are built.
 
Thanks for good comments..
12monkeys said:
Eventhandler :
--------------------
Questions / Suggestions :
- is it possible to define a hierachie on events. There may be the need, that I have multiple function on one event, and I want to process them in a specific order. Is there a way?
Currently order of calling handeler is fixed as
{ ... CustomAssets/python/custom, ... CustomAssets/python/,
.../MODS/<modname>/Assets/python/custom .../MODS/<modname>/Assets/python } order.
Within same directory, or among ../MODS/<modes-name> mod,
handelr will be called by directory entry order of python Mod file. ( A to Z order?)
But RegisterEventHander gives your handler current event map as argument,
So you have chance to modify handler list order, if you wish.
Arbitrating calling order automatically among multiple mods from many authors
are hard task. But I will study it further to be able to specify "priority" or order of excution.
12monkeys said:
Remarks :
you wrote that Mouse Button Down are not working in any function (sorry forget the name). I saw, that have it nested into the Mouse Click Event. Could it be, that the Button Downs events are only working outside the Mouse Click event? (Just a guess, I'm not even sure if I understood the problem!)
ScreeenUtils.py recives only Mouse UP event but not mouse down events.
So no chance of my functions to be called on mouse down event.
I don't know why.. I guess that Mouse down event was comsunmed already
by main interface screen itself, I guess. I will examine more on it...
In WorldBuilder screen, it recieves both mouse up and down events.
12monkeys said:
Bugs :
- you used a fixed path for "my documents/my games/...." path (again, I fogot the name of the file). This path varies depending on the localized installation. On my PC there is no such a path, so I had to change it in the code. Maybe there is way to retrieve this path it from OS environment or from the Civ INI file? Anyway, nothing serious.
Oh I see, It is easy bug to fix. Thanks...

12monkeys said:
Custom Options :
---------------------
Apart from the fact that is a good idea to use that option screen for mod configuring, I'm not sure about your modification. Is there a similar "modular" concept as for the events? As I analyzed it, all option screen modifications must be within the file "CvCustomOptions.py". If so, we have the same problem again, that people have to merge source code.
Isn't there a similar modular concept possible as you implement it for the events???
This feature is already implemented in current version. If you register custom event named 'drawOption', you will get chance to draw check box or dropdown box or any thing on Options screen (appropiate canvas will be given as argument and even automatic tooltip too)


Impaler[WrG] said:
As 12 Monkeys points out the order that moduals are called is going to be tricky, their are always going to be potentials for imcompatabilities in Mods which can only be resolved by manualy merging the code. Most of the time executing them in the right order would give us the desired results but that order is going to need to be specified by the Modual. Three types spring to mind, moduals that should execute before normal event handling, instead of it and after the normal event. We will have to assume that execution order within each of these groups is irrelivent for now. I think only one Modual that over-rides normal event handling should be allowed or else odd things could happen, an Error being generated if the game loads with more then one such modual.
See above answer to 12monkeys..
Thanks for suggestion... I will consider triple priority queue scheme...

Impaler[WrG] said:
Also I sugjest you continue to use a wraper around the Original EventManager simply to protect your Mod from future Patches/Expantion packs which might alter or add Events. Speaking of adding Events, I suspect people will want to Mod in new Event triggers such as "onChangeCivics", some though should go towards making this as hastle free as possible.
This is already done as suggested in current version. Now my EventManager is wrapper/subclass of original CvEvenManager.

Impaler[WrG] said:
Good luck with your Mod, these kind of core code improvments ultimatly turn out the be the foundation uponwhich the best Mods are built.

Thanks both of you, Impaler[WrG] and 12monkeys, for kind comment.
I will study more on point you have suggested.
 
Back
Top Bottom