Some Script Logic Questions

I am reading and trying to simplfy some codes I had written a year ago. Also trying that to prevent conflicts in coding, since I’m trying a basic match engine logic when values collides it presents a gap or weird part in match scene .

(Like despite it’s goal , understandable by comment vs acts like nothing and passes to next time slot)

So my 1st question is, since I will have several matches that I want to refer to my matchsubroutine scene , I thought if there is a value that we can add for each match scene it will be great. So in each match scene I will attain a valuable like matchcount etc and it will direct to that match scene .
So I will not have to multiply same matchsubroutine scene file with different names:

here is an example . What I want is if possible attain a value so instead of go_to friendly01match0 tzone, I can use go_to matchid tzone(will increase it’s numerical value so each time it will now which match scene to go to)

I hope I am clear on the thought I’m trying to share.

Summary

*label ap3moves
*if passtoken10 > 0
*goto no11

*if passtoken11 > 0
*goto no10

*label no11
${no11name} smoothly.
*if no11mability > opgkprmability
*goto goalfinish

*if no11mability < opgkprmability
	${no11name} tried but missed.
	Good save by the keeper!
	*set passtoken10 -1
	*goto_scene friendly01match tzone
*if no11speed > opgkprspeed
	*goto goalposition

*label no10

${no10name} smoothly.
*if no10mability > opgkprmability
*goto goalfinish

*if no10mability < opgkprmability
	${no10name} tried but missed
	Good save by the keeper!
	*set passtoken11 -1
	*goto_scene friendly01match tzone
*if no10speed > opgkprspeed
	*goto goalposition

Besides that when I have 4 main ability attributes to each player and they are mathematically letting the positions direction, attack or defence, failed or succeeded, passed or couldn’t pass or control , scored or not etc.
So I am using the method above to make the attributes clash with each other.

As soon as we identify variables (randomized as well) and make sure there is no conflict for code to read and execute all is ok. See bold below , it fixed the problem.
Also I tinkered match day file to make it more basic - to increase consistency.

Summary

*label goalfinish
*temp goalfinish
*rand goalfinish 1 5
@{(goalfinish) A spectacular header from the player … | The goalie didn’t see the ball comes like a bullet, superb flying header from the player… | A powerful shot from the player … | A sweet touch … | A Powerfull volley … }

*if (no10mability > opgkprmability ) or (no11mability > opgkprmability )
*temp finalroll
*rand finalroll 1 8
*if finalroll < 7
*goto goal
*if finalroll > 6
*goto almostgoal

*if (no10mability = opgkprmability ) or (no11mability = opgkprmability )
*temp finalroll
*random finalroll 1 8
*if finalroll < 5
*goto goal
*if finalroll > 4
*goto almostgoal
*if (no10plyability > opgkprplyability)
*goto goal
*if (no10plyability < opgkprplyability)
*goto almostgoal
*if (no11plyability > opgkprplyability)
*goto goal
*if (no11plyability < opgkprplyability)
*goto almostgoal

Edit: Found the inconsistency and fixed it, it is bold & italic. Needed to add the randomized variables to the

Thought the variables are clashing and making the outcome defunct. So solved my first question.

I will try the variable addition to scene names as @Sinnie suggested and will see.

On your first question, my understanding of what you are asking is that you have several scenes (each one is a match) and you want to choose which one to go to, based on the value of a variable.

If your matches are in individual scene files, then name each file as ‘match_1’, ‘match_2’, ‘match_3’, etc.
If your matches are all in one file, with labels for each match, then name the labels as ‘match_1’, etc.

Then use either this to go to a specific scene file:
*goto_scene match[number]
or this to go to a specific label (assuming all your matches are in a file called ‘matches’)
*goto_scene matches match[number]

Set the variable ‘number’ (or whatever you want to call it) in your code, and then it converts the value of the variable (e.g. 1, 2, 3, etc.) to ‘_1’, ‘_2’, ‘_3’, etc. - This means it will then goto scene match_1/2/3 or goto scene matches match_1/2/3.

I can write an example if that isn’t clear.


On your second question, I’m not 100% following. I think you’re saying that in the *label goal, sometimes it only displays the ‘!!! GOALLL !!!’ line and then does not display the ‘${no11name} scores ! He scored ${no11friendlygoal} goals in friendlies’ line? Is that right?

Can you clearly show an example of when it does display everything correctly, and then an example of when it does not?

For 2. Question ; I think it is solved.

As we came to 1st question; every match file will be individual txt.

Each match scene will actually carries a part of story, all the opponent stats and values , and some side events.

Since in match file story and timezones set while statistical or mathematical equations are done in match subroutine to keep it a bit tidied.

In matchsubroutine I have confrontations like I shared on the first post as an example , after the confrontation it says

*goto_scene match[idtag] tzone ( in the shared part it says goto_scene friendly01match tzone) .

// so I need to add *set idtag 0 in start up and variables and also in save file as idtag, sidtag. //

In friendly01match file I will add
*set idtag +1 ( it will be chronologically increasing by each game after each match) and rename it to match_1.txt

So if I write

*goto_scene match[idtag] tzone
It will go to match file with value 1 as it is first game. (Match_1.txt)

When I added another match I will add
*set idtag +1 so it will be 2 now. So It connects to match_2.txt .

Than a simple goto_scene match[idtag] tzone
will go and take reference of the idtag value right?

If I am in 5th match let’s say. Idtag is already = 5
Addition by each file (*set idtag +1)
So when I wrote
goto_scene[idtag] tzone in midgame for eg.

It will take reference from match_5?

If so a good portion of my question is done. And I only have tinkering left on my match formulas , which I will leave on time to prevent stalling.