Loop script stops working

Please post here for questions and discussion about modding for Strategic Command.
Post Reply
User avatar
mroyer
Posts: 1190
Joined: Sun Mar 06, 2016 12:27 pm

Loop script stops working

Post by mroyer »

I'm having trouble with a loop script (listed below) that stops working after the second successful use.

Speculate: what reasons might a loop script stop working.

There are no enemy units blocking the finish position. Weather is calm. Ships are well supplied.
I thought the script was pretty vanilla, but it seems something else is going on.

Thanks for any thoughts,
-Mark R.


{
#NAME= Loop 1
#POPUP=
#IMAGE=
#SOUND=
#FLAG= 1
#TYPE= 2
#AI= 0
#LEVEL= 0
#GV= 1[1,100]
#LINK= 0[0]
#COUNTRY_ID= 0
#ALIGNMENT_ID= 0
#TRIGGER= 100
#DELAY= 1
#FAILED_DELAY= 2
#LEVEL= 0
#FRIENDLY_POSITION=
#START_POSITION= 249,4
#FINISH_POSITION= 262,5
}
El Condoro
Posts: 208
Joined: Wed Apr 02, 2008 12:44 pm

RE: Loop script stops working

Post by El Condoro »

Just a stab - I'm still trying to work out the finer points to SC scripting, too.
You have #ALIGNMENT_ID= 0 (Neutral). Could the ship's country enter the war?
ORB & CROWN Fantasy Warfare Mod for Strategic Command
Download for War in Europe or World at War - YouTube - Discord
User avatar
mroyer
Posts: 1190
Joined: Sun Mar 06, 2016 12:27 pm

RE: Loop script stops working

Post by mroyer »

Thanks El Condoro, that's exactly the kind of "stab" I'm hoping people will toss out - and maybe someone will stumble onto the reason.

In this case I don't think it's alignment. Here's the description of alignment from the loop.txt header comments:
; #ALIGNMENT_ID= Which game turn should this loop event run? (values range [0, 2]; Any= 0; Axis= 1; Allies= 2)

Nevertheless, I'll try it anyhow just in case the comment is incorrect.

This is very peculiar [&:] - I can't spot anything wrong - so either I'm missing something obvious or it's very weird and unusual - especially where it works two times before stopping.

-Mark R.
El Condoro
Posts: 208
Joined: Wed Apr 02, 2008 12:44 pm

RE: Loop script stops working

Post by El Condoro »

I made a mistake when I mentioned #ALIGNMENT - I meant #COUNTRY.

There is no #COUNTRY= 0 in the localization file.
ORB & CROWN Fantasy Warfare Mod for Strategic Command
Download for War in Europe or World at War - YouTube - Discord
User avatar
BillRunacre
Posts: 5903
Joined: Mon Jul 22, 2013 2:57 pm
Contact:

RE: Loop script stops working

Post by BillRunacre »

Just a thought, but have you used the Update function in the Editor since modifying the script?

I've been scratching my head over this too, and am hoping it's something simple like this.
Follow us on Twitter: https://twitter.com/FurySoftware

We're also on Facebook! https://www.facebook.com/FurySoftware/
User avatar
mroyer
Posts: 1190
Joined: Sun Mar 06, 2016 12:27 pm

RE: Loop script stops working

Post by mroyer »

Yes, I update - indeed, the editor does a nice job of warning me that I need to.

Thinking along El Condoro's lines, maybe it has something to do with the fact that country ID is 0, alignment ID is 0 and friendly position is empty. I can find no example like that from the regular campaigns that come with the game. I will experiment with that when I get a few moments.

-Mark R.

User avatar
sPzAbt653
Posts: 9948
Joined: Thu May 03, 2007 7:11 am
Location: east coast, usa

RE: Loop script stops working

Post by sPzAbt653 »

Just to confirm what you probably already know:
#COUNTRY_ID= Country ID that will be owner of this naval loop event (value of 0 will allow any country to use loop positions)
#ALIGNMENT_ID= Which game turn should this loop event run? (values range [0, 2]; Any= 0; Axis= 1; Allies= 2)
#FRIENDLY_POSITION= Position that must be under friendly control in order for event to occur but can be left blank (Format: x,y)

For those that haven't noticed, each of the Script Files has a section at the top that explains a lot of stuff. Sometimes things may not be clear due to wording, in which case it might be a good idea to add your own comments to those files for your future reference.
I know when I made the Axis Middle East Loops I had to run many tests and make several changes before they were bullet-proof, but I don't recall any that worked twice and then failed. Looking forward to Mark running tests to see if he can discover what the issue is.
User avatar
mroyer
Posts: 1190
Joined: Sun Mar 06, 2016 12:27 pm

RE: Loop script stops working

Post by mroyer »

ORIGINAL: sPzAbt653
Looking forward to Mark running tests to see if he can discover what the issue is.

I tried a bunch of different combinations of those three parameters last night - all to no avail. So, the issue may not be with those.
ORIGINAL: sPzAbt653
I know when I made the Axis Middle East Loops I had to run many tests and make several changes before they were bullet-proof

If you can recall, what other sort of things did you need to buffer against to make your loops "bullet-proof". Maybe something you did will spur my thinking to a different angle.

Thanks for the thoughts.
-Mark R.
User avatar
sPzAbt653
Posts: 9948
Joined: Thu May 03, 2007 7:11 am
Location: east coast, usa

RE: Loop script stops working

Post by sPzAbt653 »

If you can recall
I can't, been too long [:(]
It stops after two turns on repeated tests, and under different circumstances ?
User avatar
mroyer
Posts: 1190
Joined: Sun Mar 06, 2016 12:27 pm

RE: Loop script stops working

Post by mroyer »

Okay, I've narrowed the issue down dramatically by creating a new, dummy campaign called 'tmp' that just has a couple land hexes and the loop start/finish locations. I copied the loop script entries into tmp campaign changing only the start and stop hex values to correspond to the red and green start/finish hexes (actually, the finish hexes are one hex to the right and down).

The issue persists, except that for the Germans the loop works twice but for the British it works once (probably a clue there). I am going to try different 'circumstances' (as sPzAbt653 suggests) to see what happens.

In the next post, I will upload the 'tmp' campaign if anyone else wants to try it to duplicate or disprove my findings.

Thanks for everyone's thoughts on this - it is a showstopper for my mod/campaign if I can't figure it out.

-Mark R.


Image
Attachments
Untitled.jpg
Untitled.jpg (81.87 KiB) Viewed 252 times
User avatar
mroyer
Posts: 1190
Joined: Sun Mar 06, 2016 12:27 pm

RE: Loop script stops working

Post by mroyer »

The dummy 'tmp' campaign, zipped up. It's only about 3 MBytes total.

-Mark R.
Attachments
tmp.zip
(2.92 MiB) Downloaded 8 times
User avatar
mroyer
Posts: 1190
Joined: Sun Mar 06, 2016 12:27 pm

RE: Loop script stops working

Post by mroyer »

I have come to believe this loop issue might be a bug in the engine. I have duplicated the effect using the vanilla 1939 Storm Over Europe scenario by moving a British ship from the Red Sea to Persian Gulf and back, repeatedly. After the third successful transfer, the loop stopped working.

-Mark R.
El Condoro
Posts: 208
Joined: Wed Apr 02, 2008 12:44 pm

RE: Loop script stops working

Post by El Condoro »

Fortunately or unfortunately, I downloaded your test campaign and played it. Over and over and couldn't get the loop to fail! I sent the ships in different directions, the same direction, and reversed their directions through the loops - at least 6 times per loop per side - and it didn't fail once.
ORB & CROWN Fantasy Warfare Mod for Strategic Command
Download for War in Europe or World at War - YouTube - Discord
User avatar
mroyer
Posts: 1190
Joined: Sun Mar 06, 2016 12:27 pm

RE: Loop script stops working

Post by mroyer »

ORIGINAL: El Condoro
Fortunately or unfortunately

Thanks for doing that El Condoro! That is a HUGE clue - I'm not sure where it will lead me yet,
but if this is a me-only issue, perhaps my install is bungled up somehow, or I'm on the wrong version,
or something else like that.

My mind is swimming with new experiments to be done...

-Mark R.
User avatar
mroyer
Posts: 1190
Joined: Sun Mar 06, 2016 12:27 pm

RE: Loop script stops working

Post by mroyer »

So, I did a complete uninstall, installed the original SC3 game, did the v1.15 update and have what I believe is a pristine installation - no mods whatsoever. I put the little 'tmp' mod in and still I have the problem of loops stopping to work... wtf [:@].... is it possible that it is a user issue - is there anything I could be doing as a player that disables loops somehow?

-Mark R.
User avatar
BillRunacre
Posts: 5903
Joined: Mon Jul 22, 2013 2:57 pm
Contact:

RE: Loop script stops working

Post by BillRunacre »

Hi Mark

I don't see why, as if a type= 2 loop works once, it should work twice.

I've just downloaded your campaign but probably won't have time today to test it out, but I'll report back after I have.

Bill
Follow us on Twitter: https://twitter.com/FurySoftware

We're also on Facebook! https://www.facebook.com/FurySoftware/
User avatar
Hubert Cater
Posts: 5875
Joined: Mon Jul 22, 2013 11:42 am
Contact:

RE: Loop script stops working

Post by Hubert Cater »

Thanks and I believe I found the issue and will correct this for the next build.
User avatar
mroyer
Posts: 1190
Joined: Sun Mar 06, 2016 12:27 pm

RE: Loop script stops working

Post by mroyer »

ORIGINAL: Hubert Cater

Thanks and I believe I found the issue and will correct this for the next build.


Whoa, whoa, WHOA!!! This is big.... thanks Hubert and Bill for digging into this. Exactly what did you find? Is it something specific with how I'm writing a loop script or an issue in general? Why was El Condoro able to use the loops in my test campaign, but not me?

Anyhow, thanks for letting us know.
-Mark R.
User avatar
BillRunacre
Posts: 5903
Joined: Mon Jul 22, 2013 2:57 pm
Contact:

RE: Loop script stops working

Post by BillRunacre »

It was deep in the engine, hence it had inconsistent results - which I had too, which had me as confused as you were for a while.
Follow us on Twitter: https://twitter.com/FurySoftware

We're also on Facebook! https://www.facebook.com/FurySoftware/
User avatar
mroyer
Posts: 1190
Joined: Sun Mar 06, 2016 12:27 pm

RE: Loop script stops working

Post by mroyer »

> which had me as confused as you were for a while.
[:'(]
Well, I hope you guys have gotten to the bottom of this.
I appreciate all the effort to get there!

-Mark R.
Post Reply

Return to “Scenario Design and Modding”