Please login or register.

Login with username, password and session length
 

News:

Happy 20th Birthday, Freedom Force !!!


Author Topic: [Champions] Definitive FFX2.6 module order  (Read 2130 times)

Offline Symon

  • Hero Member
  • Posts: 652
    • Ereshkigal
[Champions] Definitive FFX2.6 module order
« on: April 29, 2013, 07:09:19 PM »
Having found my Freedom Force disks, I decided it was time to pick up the reins of old projects. One of the things I intend to tackle is my old Champions Campaign.

Now the thing that caused me issues with this in the past was module import order (e.g from module import *)

Basic Freedom Force was always fairly clear (if a bit vague on which modules needed 'import module', which 'from module import *' and which wanted both.

Dr Mike's documentation and the example included for Hero_City_Gold are fairly clear. Problem is, those may have been for early versions. I suspect this because following those instructions breaks 'Stealthy' and the script log shows that that attribute just isn't working. Almost certainly a scope issue. FFX only mostly works with that, but I'm really not certain the M25 ai extensions are working too well.

Given time and experimentation, I'll crack this, but wondered if anyone (I'm looking at Stumpy) has any insights on this. Almost every FFX enabled mod I have does this differently and of course FF3R is very different and cannot be a guide.

So? Any guidance?
« Last Edit: April 29, 2013, 09:39:40 PM by Symon »
"You fertility deities are worse than Marxists," he said. "You think that's all that goes on between people."

Roger Zelazny, Lord of Light. 1971.

Offline Epimethee

  • Patron god of afterthought
  • Hero Member
  • Posts: 2905
  • Currently in suspended animation
    • FFX add-on for FFvsTTR
Re: [Champions] Definitive FFX2.6 module order
« Reply #1 on: May 01, 2013, 11:03:39 AM »
Sorry if Stealthy is causing you headaches. IIRC that attribute had severe performance issues (never ported it to FFX 3 in part because of that). If you disable it, does it have any impact?

I'd like to be able to look into it, but I'm out of town… Anyway, it's definitively not as if I could do anything you can't.
FFX add-on for FFvsTTR at ffx.freedomforceforever.com

Offline Symon

  • Hero Member
  • Posts: 652
    • Ereshkigal
Re: [Champions] Definitive FFX2.6 module order
« Reply #2 on: May 04, 2013, 11:24:25 PM »
Thanks for the vote of confidence (grin).

Actually it isn't really Stealthy that is giving me an issue. I've been trying several import strategies, and in some it works just fine. For example, I tried, expecting nothing:
Code: [Select]
from m252 import *
from ffx import *
Works far better than I expected. Stealthy is just perfect, but then query functions seem not to work.

Actually another serious issue is stopping the M25 extensions from over-riding scripted goals. At a certain point, I need a Villain to flee to a marker. Without M25AI enabled, he does this just fine. With it enabled, he starts to flee, evaluates things and leaps back into the fray. Not the aim as you can imagine. Trying to find the best way to disable M25  for a single character when needed (and then re-enable it).
"You fertility deities are worse than Marxists," he said. "You think that's all that goes on between people."

Roger Zelazny, Lord of Light. 1971.

Offline Symon

  • Hero Member
  • Posts: 652
    • Ereshkigal
Re: [Champions] Definitive FFX2.6 module order
« Reply #3 on: May 08, 2013, 06:46:11 PM »
OK, I seem to be making good progress on this. I've made a few edits after my memory of what I'd actually tested improved.
I've turned on every diagnostic print, then added more of my own and have come to the following conclusions:

So far it looks like the best way to import FFX2.6Gold for scenarios (Note this is NOT FF3R but FF) is a combination of the m25 and ffx2.6 instructions.
Code: [Select]
from m252 import *
from cshelper import *
# Any other imports here e.g.
from missionobjvar import *
from prestige import *
m252 BEFORE cshelper (maybe). That gets you:-
ff, js, cshelper, event, ai, goal, m25lib2, m25script2, m25newai2 and m25config2S or m25config2
all functions in global scope.

cshelper (importing again seems to work best, which surprises me) which gets you:
random, types, prestige.getPrestige and ffx in global.

ffx gets you m25ffxtactics, m25objfind and a load of stuff in local (use an ffx prefix if you need it).
As I said, loading cshelper again seems to be best, still checking that's not redundant. Not importing m252 gives many errors. Not importing cshelper isn't anywhere near as bad. It may be not required. I'll try to firm that up but I seem to recall errors with a few attributes without it.

I find it best to put all that (plus any code you want yourself to be re-usable) in something like champions.py and then import that into your mission scripts with :
Code: [Select]
from champions import *
In your actual mission.py file, you should call
setMission()
sun()
usually in onPostInit(), at least once.
The m25 notes say call NextStage() after new characters are spawned and this does seem best; still investigating.

One thing that I've not seem properly documented is that war() and peace() need to be replaced by m25War() and m25Peace(). In a cutscene that's ff.m25War() and ff.m25Peace(). Yes, watch out for the case change. (I've never liked camel-case personally but it's well established. This is why. Spent some time trying to work out why m25war was not importing. Especially as it replaces war(), ..... very tempted to define m25war and m25peace).

In m252lib, this:
#added the ability to disable only the m25 AI on a character
Looked promising. It appears to be an attribute, ai_m25disabled, on every character/object. Sadly it is not implemented. You can set or unset it but nothing ever checks it.

I'm implementing that as it's exactly what I need I think. m25Peace is proving a good guide as to where so far. You can't write a set of scenarios if you can't give strategic instructions like 'get out of dodge'. I've managed to turn off much m25ai activity on single character reliably but that character is still ignoring goals, like move to a marker.
« Last Edit: May 08, 2013, 09:39:29 PM by Symon »
"You fertility deities are worse than Marxists," he said. "You think that's all that goes on between people."

Roger Zelazny, Lord of Light. 1971.

Offline BentonGrey

  • Titans
  • Hero Member
  • Posts: 16768
    • The Greylands
Re: [Champions] Definitive FFX2.6 module order
« Reply #4 on: May 08, 2013, 10:09:46 PM »
This is all quite over my head, but good luck Symon!  We always need new (or old) modders!
God Bless
"If God came down upon me and gave me a wish again, I'd wish to be like Aquaman, 'cause Aquaman can take the pain..." -Ballad of Aquaman
Check out mymods and blog!
https://bentongrey.wordpress.com/

Offline Symon

  • Hero Member
  • Posts: 652
    • Ereshkigal
Re: [Champions] Definitive FFX2.6 module order
« Reply #5 on: May 15, 2013, 05:30:06 PM »
OK, I seem to be pretty much there.

Currently, I recommend importing FFX2.6Gold for scenarios (Note this is for FF) in a combination of the m25 and ffx2.6 instructions.
The imports
Code: [Select]
from m252 import *
# Any other imports here e.g.
from sound import *
from missionobjvar import *
from prestige import *

Importing cshelper doesn't seem required if you get everything else right.

I find it best to put all that (plus any code you want yourself to be re-usable) in something like champions.py and then import that into your mission scripts with :
Code: [Select]
from champions import *
Mission.py
In your actual mission.py file, you should call
setMission()
sun()
usually in onPostInit(), at least once.
If you spawn new characters (Heroes or Villains) during the mission then call NextStage().

All calls to war() and peace() need to be replaced by m25War() and m25Peace(). In a cutscene that's ff.m25War() and ff.m25Peace(). Yes, watch out for the case change.

The CGenericMinion AI is great. It'll use all 5 tier A powers and flies quite readily. However, it seems very hard to get it to respond to goals of any priority. If you are writing an actual scenario, you probably want to use one of the AIs M25 suggests or roll your own with m25.py.

First Mission is now almost complete.
« Last Edit: May 15, 2013, 05:31:38 PM by Symon »
"You fertility deities are worse than Marxists," he said. "You think that's all that goes on between people."

Roger Zelazny, Lord of Light. 1971.

Offline Symon

  • Hero Member
  • Posts: 652
    • Ereshkigal
Re: [Champions] Definitive FFX2.6 module order
« Reply #6 on: May 27, 2013, 06:54:31 PM »
First mission is just about done. Currently tediously sorting camera angles for the cutscenes for both it and mission 2.

As a brief look at the plans here, the WIP mission titles:
1. Break in at the Avery's
2. Arms shipments
3. Demon Assault
4A. Enemies Assemble
4B. Pursuit into darkness
5A. Ancient Malice
5B. Malice anew
5C. Last piece
6. Arcane Quest
7. Malice
8. Capture
9. Escape
10. Finale
11. GRAB
12A. A Rose by any other name.
12B. A Rose has thorns.
13. Red Rose
14. Revelations
15. Final Straw
16. New costume, new job.
17. Histories and Mysteries.
18. Hands up who's evil here?
19. Mothers
20. Daughters
21. Mistresses of Magic
« Last Edit: May 27, 2013, 07:46:04 PM by Symon »
"You fertility deities are worse than Marxists," he said. "You think that's all that goes on between people."

Roger Zelazny, Lord of Light. 1971.

Offline BentonGrey

  • Titans
  • Hero Member
  • Posts: 16768
    • The Greylands
Re: [Champions] Definitive FFX2.6 module order
« Reply #7 on: May 27, 2013, 10:15:41 PM »
Wow, very ambitious!  I can't wait to see this thing come to fruition! :D
God Bless
"If God came down upon me and gave me a wish again, I'd wish to be like Aquaman, 'cause Aquaman can take the pain..." -Ballad of Aquaman
Check out mymods and blog!
https://bentongrey.wordpress.com/

Offline Cyber Burn

  • Hero Member
  • Posts: 8863
Re: [Champions] Definitive FFX2.6 module order
« Reply #8 on: May 28, 2013, 07:34:37 PM »
That looks like it's going to be a HUGE mod. It looks to be an enormous undertaking. Definitely the best of luck with this project.