Scripting under 1.10 - question

A forum to discuss custom scenarios, campaigns and modding in general.

Moderators: Slitherine Core, Panzer Corps Moderators, Panzer Corps Design

Post Reply
bebro
Slitherine
Slitherine
Posts: 4453
Joined: Sun Nov 19, 2006 12:50 pm

Scripting under 1.10 - question

Post by bebro »

Most of the new options seem easy to figure out, but what do "run count" and "skip count" mean?

Is "run count" how often script X is executed during a scenario? Still, I dunno what "skip" is for...


Also, is it possible to have a msg via script getting displayed at the start of turn 1, but *after* the deployment stage? I'm giving free units in some cases at turn 1, and the game places them only after deployment is over (which is per se no prob). But it means these units also are not visible before on-map, so not *during* the deployment.

I want to display a "unit x has been put under your command" text msg right when these units are present. But when I set the trigger to turn 1,1, I get the msg during deployment (when they're actually not placed by the game yet). I tried to edit the trigger to fire ("instantly" setting) when the correct unit, name, type, number is present on map, but either my trigger has errors, or it somehow doesn't work. Does anybody have an idea how to solve this?
nikivdd
Panzer Corps Map Designer
Panzer Corps Map Designer
Posts: 4520
Joined: Fri Jun 24, 2011 1:21 pm
Location: Belgium
Contact:

Re: Scripting under 1.10 - question

Post by nikivdd »

bebro wrote:Most of the new options seem easy to figure out, but what do "run count" and "skip count" mean?

Is "run count" how often script X is executed during a scenario? Still, I dunno what "skip" is for...


Also, is it possible to have a msg via script getting displayed at the start of turn 1, but *after* the deployment stage? I'm giving free units in some cases at turn 1, and the game places them only after deployment is over (which is per se no prob). But it means these units also are not visible before on-map, so not *during* the deployment.

I want to display a "unit x has been put under your command" text msg right when these units are present. But when I set the trigger to turn 1,1, I get the msg during deployment (when they're actually not placed by the game yet). I tried to edit the trigger to fire ("instantly" setting) when the correct unit, name, type, number is present on map, but either my trigger has errors, or it somehow doesn't work. Does anybody have an idea how to solve this?
Just an idea...not tested
Image
The number 30 is just an example. It could be 28 core units that the player can deploy and an extra 2 preplaced on the map. And since the two extra are only seen after the deployment phase...
Then you need to add the action "show msg", eventually a center action too.
https://www.facebook.com/NikivddPanzerCorps
https://www.youtube.com/channel/UCk2lyeEuH_hoA1s7tnTAEJQ
Chris10
Captain - Bf 110D
Captain - Bf 110D
Posts: 890
Joined: Tue Mar 27, 2012 1:06 am
Location: Spain

Re: Scripting under 1.10 - question

Post by Chris10 »

bebro wrote:Most of the new options seem easy to figure out, but what do "run count" and "skip count" mean?
Is "run count" how often script X is executed during a scenario? Still, I dunno what "skip" is for...
I would assume the following:
Example
Trigger = Turn 3
Run Count = 5 < means script to be executed 5 times
Skip Count = 2 < skipped two turns times from last execution

Now the script runs 5 times on the following turns
3,6,9,12,15

just wild guessing of course :D
bebro wrote: Also, is it possible to have a msg via script getting displayed at the start of turn 1, but *after* the deployment stage?
I think messages only work at start turn as they caused problems during AK beta when displayed middle turn or during AI turn
Chris10
Captain - Bf 110D
Captain - Bf 110D
Posts: 890
Joined: Tue Mar 27, 2012 1:06 am
Location: Spain

Re: Scripting under 1.10 - question

Post by Chris10 »

Chris10 wrote:
bebro wrote:Most of the new options seem easy to figure out, but what do "run count" and "skip count" mean?
Is "run count" how often script X is executed during a scenario? Still, I dunno what "skip" is for...
I would assume the following:
Example
Trigger = Turn 3
Run Count = 5 < means script to be executed 5 times
Skip Count = 2 < skipped two turns times from last execution

Now the script runs 5 times on the following turns
3,6,9,12,15

just wild guessing of course :D
Trash what I said... :mrgreen:
I just checked in depth

The run count is the times the script gets executed..the skip count starts ONE time from the moment the script is triggered...so its a one time action

Example
I set: give axis prestige 1000 on turn 2 ..Run count 2 and Skip count 2
Now on turn 2 the script is triggered but the skip count kick in and the script is ignored for 2 turns (turn 2 and 3)
It starts adding a 1000 at turn 4 and since the run count is 2 it will add a 1000 on turn 4 and turn 5...

The usefulness of this is quite debatable and personally I think there could have been a better implementation of script run times,skip times,repeatedly running scripts with ignoring times in between but hey...thats what we got :wink:
bebro
Slitherine
Slitherine
Posts: 4453
Joined: Sun Nov 19, 2006 12:50 pm

Re: Scripting under 1.10 - question

Post by bebro »

Thx a bunch both of you, now it's more clear :)

Though I didn't get the msg to appear in turn one, but after deployment. In the end I just changed the text somewhat so that it says the unit will arrive at the beginning of the ops...
bebro
Slitherine
Slitherine
Posts: 4453
Joined: Sun Nov 19, 2006 12:50 pm

Re: Scripting under 1.10 - question

Post by bebro »

A couple of more questions: does it help the AI when you set a zone in unit params for orders others than "move to"? I mean does the zone specified also work when the unit has set "disembark" or "attack", so that for example the unit will try to get to zone x with "attacker" role switched on?

Or do I have to use "move to" for getting them to a zone, then script it again to set it to attacker once it's there?

I tested a bit with disembark but wasn't that satisfied with the results, because the AI still traveled around back and forth before landing. Though might have been that my landing zone was too spread out, while nearby beach hexes were still occupied...probably need to test again...

Apart from this the new scripting options are cool, esp. in combi with giving messages out for major developments or changes during an scn :)
Rudankort
FlashBack Games
FlashBack Games
Posts: 3836
Joined: Sat Aug 21, 2010 2:23 pm
Contact:

Re: Scripting under 1.10 - question

Post by Rudankort »

AI zone is mandatory for the following 5 AI orders:

Move To. The unit will move to the nearest hex in AI zone, then next nearest and until the zone is exhausted. Then its behavior will reset to Default.
Random Move To. The unit will select random hex from AI zone and move there. Then its behavior will reset to Default.
Patrol. The unit will move to the nearest hex in AI zone, then next nearest etc. untis the zone is exhausted, then it will start from the first hex again etc. in a loop.
Random Patrol. On every turn the unit will choose a random hex from AI zone and move there.
Disembark. The unit will choose a random hex from AI zone and will move and then disembark there. Then its behavior will reset to Default. This behavior is similar to "Random Move To", only disembark action is added in the end.

All the other AI behaviors do not use AI zone setting.
bebro
Slitherine
Slitherine
Posts: 4453
Joined: Sun Nov 19, 2006 12:50 pm

Re: Scripting under 1.10 - question

Post by bebro »

Thank you for the clarification.
bebro
Slitherine
Slitherine
Posts: 4453
Joined: Sun Nov 19, 2006 12:50 pm

Re: Scripting under 1.10 - question

Post by bebro »

Here's another question that came to me recently: if you change the objectives in the midst of a scenario, is there any way that those changes affect the PZLOC file so that you get the updated goals displayed between the turns?
Rudankort
FlashBack Games
FlashBack Games
Posts: 3836
Joined: Sat Aug 21, 2010 2:23 pm
Contact:

Re: Scripting under 1.10 - question

Post by Rudankort »

bebro wrote:Here's another question that came to me recently: if you change the objectives in the midst of a scenario, is there any way that those changes affect the PZLOC file so that you get the updated goals displayed between the turns?
No, at the moment there is no way to change objective description text "on the fly".
bebro
Slitherine
Slitherine
Posts: 4453
Joined: Sun Nov 19, 2006 12:50 pm

Re: Scripting under 1.10 - question

Post by bebro »

I see, thanks. Well, people can always access older messages in the meantime to read about changes again...
Elpatriarche
Private First Class - Opel Blitz
Private First Class - Opel Blitz
Posts: 4
Joined: Sun Mar 20, 2016 8:57 pm

Re: Scripting under 1.10 - question

Post by Elpatriarche »

Chris10 wrote: Mon Oct 01, 2012 12:58 pm
Chris10 wrote:
bebro wrote:Most of the new options seem easy to figure out, but what do "run count" and "skip count" mean?
Is "run count" how often script X is executed during a scenario? Still, I dunno what "skip" is for...
I would assume the following:
Example
Trigger = Turn 3
Run Count = 5 < means script to be executed 5 times
Skip Count = 2 < skipped two turns times from last execution

Now the script runs 5 times on the following turns
3,6,9,12,15

just wild guessing of course :D
Trash what I said... :mrgreen:
I just checked in depth

The run count is the times the script gets executed..the skip count starts ONE time from the moment the script is triggered...so its a one time action

Example
I set: give axis prestige 1000 on turn 2 ..Run count 2 and Skip count 2
Now on turn 2 the script is triggered but the skip count kick in and the script is ignored for 2 turns (turn 2 and 3)
It starts adding a 1000 at turn 4 and since the run count is 2 it will add a 1000 on turn 4 and turn 5...

The usefulness of this is quite debatable and personally I think there could have been a better implementation of script run times,skip times,repeatedly running scripts with ignoring times in between but hey...thats what we got :wink:
Thx a lot for the explanation! :D
Alex Elpatriarche
Post Reply

Return to “Panzer Corps : Scenario Design”