Scripting under 1.10 - question
Moderators: Slitherine Core, Panzer Corps Moderators, Panzer Corps Design
Scripting under 1.10 - question
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?
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?
-
- Panzer Corps Map Designer
- Posts: 4520
- Joined: Fri Jun 24, 2011 1:21 pm
- Location: Belgium
- Contact:
Re: Scripting under 1.10 - question
Just an idea...not testedbebro 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?

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
https://www.youtube.com/channel/UCk2lyeEuH_hoA1s7tnTAEJQ
Re: Scripting under 1.10 - question
I would assume the following: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...
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

I think messages only work at start turn as they caused problems during AK beta when displayed middle turn or during AI turnbebro wrote: Also, is it possible to have a msg via script getting displayed at the start of turn 1, but *after* the deployment stage?
Re: Scripting under 1.10 - question
Trash what I said...Chris10 wrote:I would assume the following: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...
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![]()

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

Re: Scripting under 1.10 - question
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...

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...
Re: Scripting under 1.10 - question
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
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

Re: Scripting under 1.10 - question
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.
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.
Re: Scripting under 1.10 - question
Thank you for the clarification.
Re: Scripting under 1.10 - question
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?
Re: Scripting under 1.10 - question
No, at the moment there is no way to change objective description text "on the fly".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?
Re: Scripting under 1.10 - question
I see, thanks. Well, people can always access older messages in the meantime to read about changes again...
-
- Private First Class - Opel Blitz
- Posts: 4
- Joined: Sun Mar 20, 2016 8:57 pm
Re: Scripting under 1.10 - question
Thx a lot for the explanation!Chris10 wrote: ↑Mon Oct 01, 2012 12:58 pmTrash what I said...Chris10 wrote:I would assume the following: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...
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![]()
![]()
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![]()

Alex Elpatriarche