User avatar
Bohémond
Posts: 2810
Joined: Wed May 14, 2008 8:47 pm

ChangeFactionTag for NCP 1.7b2

Mon Jun 14, 2010 4:33 pm

Hello,

This Script Command doesn't seems to be allowed by NCP 1.7b2 engine; Unknow keyword in ScriptReport.

Is it WAD ?

User avatar
Pocus
Posts: 25673
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Tue Jun 15, 2010 8:27 am

My fault, it is ChgFactionTag

Sometime when the keyword is too long I use 'chg' and not 'change'... I would need to unify all that ideally...
Image


Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's law."

User avatar
Bohémond
Posts: 2810
Joined: Wed May 14, 2008 8:47 pm

Tue Jun 15, 2010 1:40 pm

Thank you Pocus, I will try with the correct syntax tonight.

Maybe can somebody make a correction in AGEwiki ? ;)

Regards

User avatar
lodilefty
Posts: 7616
Joined: Sat Aug 11, 2007 3:27 pm
Location: Finger Lakes, NY GMT -5 US Eastern

Tue Jun 15, 2010 10:36 pm

Bohémond wrote:Maybe can somebody make a correction in AGEwiki ? ;)

Regards


Done. :)
Always ask yourself: "Am I part of the Solution?" If you aren't, then you are part of the Problem!
[CENTER][/CENTER]
[CENTER]Visit AGEWiki - your increasingly comprehensive source for information about AGE games[/CENTER]

[CENTER]Rules for new members[/CENTER]
[CENTER]Forum Rules[/CENTER]

[CENTER]Help desk: support@slitherine.co.uk[/CENTER]

User avatar
Bohémond
Posts: 2810
Joined: Wed May 14, 2008 8:47 pm

Wed Jun 16, 2010 2:51 am

Sorry but there is something quite not clear for me.

Using the right syntax, Each time, see 4 tests below, I got this, in script report file,

[Warning] ChangeFactionTag command, both factions must share the same FactionFileID.

First test ; from C08 ( file name 620C08, UID = 62 ) changing to COB ( file name 780COB, UID = 78).

Second test ; from C08 ( file name 620C08, UID = 62 ) changing to COB ( file name 780COB, UID = 62).

Third Test ; from C08 ( file name 620C08, UID = 62 ) changing to COB ( file name 620COB, UID = 62).

Third Test ; from C08 ( file name 620C08, UID = 62 ) changing to COB ( file name 620COB, UID = 78).



What I am doing wrong ?

Regards

User avatar
Pocus
Posts: 25673
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Wed Jun 16, 2010 10:40 am

This an experimental feature, it has been tested a few time on a test scenario, but not beyond that.

There is a constraint when you switch a faction to another: they must both have the same FactionFileID. This entry is a value in the faction file, if absent, then FactionFileID = FactionTag.

So in your case, C08 <> COB, so the code reject it.

You'll want to use the 'primary faction' faction tag as the common FactionFileID. The constraint is necessary so that when you change faction, it does not change the file names of the saved game.

For example when you play as Prussia in the future Vainglory of Nation, then your saved game files are called GER.

Both PRU and GER share the same faction file ID (GER in this case).
Image


Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's law."

User avatar
Bohémond
Posts: 2810
Joined: Wed May 14, 2008 8:47 pm

Wed Jun 16, 2010 1:26 pm

Added Entry FactionFileID = C08 in COB faction file

It works, from ScriptReport ;

ChangeFactionTag Coalition faction is now pointing to the definitions of this faction tag: COB

Thank you.

Regards

User avatar
Bohémond
Posts: 2810
Joined: Wed May 14, 2008 8:47 pm

Wed Jun 16, 2010 4:07 pm

Some weird results ;

When asking for next turn ; " le tour de l'adversaire est manquant, voulez vous vraiment traiter ce tour en passant en IA "

As it's a expirimental feature, I will not argue about it and try to find another way to make a subfaction enters a alliance dynamically.

Sorry for my, maybe, bad english.


Regards

User avatar
Pocus
Posts: 25673
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Thu Jun 17, 2010 3:10 pm

Un Français parle à un Français (ou un Francophone tout du moins?) :)

I'll take a look, experimental does not mean broken, so this will be fixed.
Image


Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's law."

User avatar
Bohémond
Posts: 2810
Joined: Wed May 14, 2008 8:47 pm

Thu Jun 17, 2010 5:47 pm

Good news,

It will be very useful for me to use this scipt command.

I got some errors using the ChangeRgnOwner Script command.

Let me know if you want me to give you more details ( ScriptReport and Mainlog) about this one too.

Regards.

FYW ; français vivant au Canada.

User avatar
Pocus
Posts: 25673
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Mon Jun 21, 2010 4:48 pm

Yes please give me the scriptpostparse and scriptreport file when you get also the errors with ChangeRgnOwner.
Image


Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's law."

User avatar
Bohémond
Posts: 2810
Joined: Wed May 14, 2008 8:47 pm

ChangeRgnOwner files

Tue Jun 22, 2010 3:51 am

Hello Pocus,

Attached is an archive with ScriptReport, ScriptPreParse, ScriptPostParse and MainLog.

Context ; Austria ( Tag ; AUS) is a neutral Faction, the regions owned by Austria are given to Coalition ( COA).

The Event works and the syntax is correct as you can see in ScripReport (line 6074 to 6543)

The error seems seems to be generated by the fact that Austria and Coaliition are not enemies. See Mainlog.

Let me know if you need something else.

Regards
Attachments
ChangeRgnOwner.rar
(91.83 KiB) Downloaded 352 times

User avatar
Pocus
Posts: 25673
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Wed Jun 23, 2010 3:43 pm

I see quite many errors in the main log, like units referenced with a wrong alias and some others things, have you changed the database? I won't be able to intervene if you did.

ChangeRgnOwner works, I tested with this simple script in the Saxony Scenario, provoking the loss of Prussia on first turn :)

(Rise of Prussia test as you can see, not NCP)

SelectFaction = AUS

StartEvent = evt_nam_Test|1|0|NULL|NULL|$Berlin|NULL

Conditions

Actions

ChangeRgnOwner = PRU

EndEvent

I advise that you progress only step by step so that each error can be identified independently. For now, forget about changing a faction into another, I'm still on it but I'm not finished... more on that in a few days.

Thanks for your patience.
Image


Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's law."

User avatar
Bohémond
Posts: 2810
Joined: Wed May 14, 2008 8:47 pm

Wed Jun 23, 2010 5:08 pm

Hello Pocus,

To check the ChangeRgnOwner Errors, I have made a scenario, TestCampaign, without any troops only a map ( Cities and Subfaction files) and one Event file.

Here are the context of my test

Event CRO1 ;

Selected Region Parallo from FRE to COA ( FRE and COA are enemies)

Event CRO2

Selected Region Genoa from FRE to COA ( FRE and COA are enemies )

Event CRO3

Selected Region Passau from AUS to COA ( AUS is neutral as POL in ROP )

Event CRO4

Selected Region Ceske from AUS to COA ( AUS is neutral as POL in ROP )

Summary ;

In main log, only Reporting for Passau and Genoa bur errors for Parallo and Ceske.

So in previous post I was wrong, the error is not generated by the region to be owned by a neutral Faction.

Now I think, maybe I,m wrong too, that the error is generated by the fact that Ceske and Parallo have no structures ( City ). No error for Passau and Genoa because they got structure.

Attached is an archive with ScriptReport, ScriptPreParse, ScriptPostParse, Main Log and Event file.

Let me know if you need something else.

Regards


PS ; J'espère que mes remarques ne sont ni déplacées ni trop consommatrices de temps pour vous. Si c'était le cas merci de m'en faire part, je comprends que votre temps est précieux et que vous avez des projets en cours (VGN).

PS2 ; Concernant les erreurs , je n'ai pas touché au DB, voudriez vous que je fasse un rapport d'erreur sur un scenario "vanilla" à partir d'une installation propre de NCP 1.7b2
Attachments
ChangeRgnOwner2306.rar
(3.62 KiB) Downloaded 325 times

User avatar
Pocus
Posts: 25673
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Fri Jun 25, 2010 2:41 pm

That's no problem and I'm more than willing to fix any engine bug. I would prefer to get a saved game though, it allows me to test for sure I fixed the bug. You will need to send me in a single archive the turn that is crashing (before the hosting is complete) ,or if the hosting manages to finish even with a crash, then the current turn plus backup1.
Image


Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's law."

User avatar
Bohémond
Posts: 2810
Joined: Wed May 14, 2008 8:47 pm

ChangeRgnOwnerTest files

Sat Jun 26, 2010 3:47 am

Hello,

Please find enclose ;

Current turn+Backup1 in ChangeRgnOwnerTest folder
Test.sct file for the 4 events used
ScriptReport, ScriptPreParse and ScriptPostParse
Mainlog with errors.

Based on 1808Finland scenario, I made a scenario named Test ( without troops)

NCP 1.7b2.

Hope that will be helpful

Let me know if you need something else.

Regards
Attachments
ChangeRgnOwnerTest.rar
(324.76 KiB) Downloaded 382 times

User avatar
Pocus
Posts: 25673
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Mon Jun 28, 2010 4:01 pm

That should be ok, thanks, I'll work with that
Image


Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's law."

User avatar
Pocus
Posts: 25673
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Wed Jun 30, 2010 9:21 am

Hi Bohémond

Bugs fixed, Narva is now Swedish and Sveaborg is now Russian! Thanks for your help, the next NCP beta patch (this day hopefully) will have the fix.

If you can reproduce a problem with ChgFactionTag with a simple test scenario then I can check it too.
Image


Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's law."

User avatar
Bohémond
Posts: 2810
Joined: Wed May 14, 2008 8:47 pm

Wed Jun 30, 2010 12:34 pm

Hello Pocus,

I will try today before noon (Estern Time).

Regards

User avatar
Bohémond
Posts: 2810
Joined: Wed May 14, 2008 8:47 pm

ChgFactionTagTest Files

Wed Jun 30, 2010 1:37 pm

Hello,

Please find enclose , playing as RUS ;

Current turn+Backup1+Backup2 in ChgFactionTagRus folder
Test.sct file for the event used
750TSA.fac file for new faction, just added CAU as nativeTag and FactionFileID entry.
ScriptReport, ScriptPreParse and ScriptPostParse for current turn whith ScriptReport Error telling no Faction is selected
Mainlog and HostLog

I got the messge box telling the oponent turn is missing between Backup1 and current turn. Backup2 is the turn 0 of scenario.

Note ; Playing with SWE on the same test scenario, no message box, for your information attached ChgFactionTagTestSWE folder with saves.

Based on 1808Finland scenario, scenario named Test ( without troops)

NCP 1.7b2.

Hope that will be helpful

Let me know if you need something else.

Regards
Attachments
ChgFactionTag.rar
(991.26 KiB) Downloaded 339 times

User avatar
Pocus
Posts: 25673
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Tue Jul 06, 2010 4:00 pm

Hi Bohémond,

I'm unsure about what happened in your test. I used your new FAC file, which I modified further (renaming Russian to New Russian). I used the Finland scenario, and in the event file added Test.sct

The script reports that everything worked as expected...

Image
Russia called New Russian (population still named 'Russians', not 'New Russians', but that's because I forgot to change that, not a bug)

Here is the script after parsing but before execution, as you see your event is included as is, after the regular events of the scenario:

000398
000399
000400 SelectFaction = $RUS
000401 SelectRegion = $Sveaborg
000402 StartEvent = CFT2|1|0|NULL|NULL|NULL|NULL
000403
000404
000405 Conditions
000406 MinDate = 1808/01/01
000407
000408 Actions
000409
000410 SelectFaction = $RUS
000411
000412
000413 ChgFactionTag = TSA
000414
000415 EndEvent
000416
000417


Then I process the turn

Line 397: ------------------------------
Line 400: SelectFaction, selected: Russia
Line 402: Started processing event: CFT2
Line 402: This event is not yet referenced, base number of allowed occurences 1
Line 406: Min date evaluated: 1808/01/01 converted to turn 2785 current turn 2792 True
Line 408: Entering triggered actions for event CFT2
Line 410: SelectFaction, selected: Russia
Line 413: ChgFactionTag New Russian faction is now pointing to the definitions of this faction tag: TSA
Line 415: Finished processing event: CFT2

And I do get a change of Faction...
Image


Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's law."

User avatar
Bohémond
Posts: 2810
Joined: Wed May 14, 2008 8:47 pm

Tue Jul 06, 2010 5:41 pm

Hello Pocus,

The script command ChgFactionTag works fine for me too , as you can see in previous atteched file.

The problem appears as soon as I click on the ''Next turn'' button and I got the message box ''Oponent turn missing''.

Have you try to go to next turn during your test ?

Thank you

Regards

User avatar
Pocus
Posts: 25673
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Wed Jul 07, 2010 4:44 pm

No I don't get the problem. I believed you had one because of your script which reported 'No Selected Faction' strangely...
Image


Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's law."

Return to “Modding AGE engine games”

Who is online

Users browsing this forum: No registered users and 8 guests