How trigger a set point after you merged with a AI player

Tips and Tricks on Events, Economy, etc.
OilCan

Re: How trigger a set point after you merged with a AI player Unread post

Falcen81 wrote:tried many setting Force test against companies with there is a company with ID True. Triggert but the wrong way
change there is a company with ID to "FALSE" No trigger, After the merge also not. Still wrong
I too have found this did not work, at least I could not figure out a way for it to work. My solution was not to test if the company was gone, but rather to test if it was still on the map.
This solution is practical for 7 AI companies at the most.
Let's assume the player owns Company ID=1 and the AIs own Companies IDs 2-5.
For AI Company ID=2:
The condition: Company ID=2 .... There is a company with ID is TRUE.... Test against..AI companies only.... Test at end of week.
The effect: Game Variable1+1

For AI Company ID=3:
The condition: Company ID=3.... There is a company with ID is TRUE.... Test against..AI companies only.... Test at end of week.
The effect: Game Variable1+10

For AI Company 4, Game Variable1+100
For AI Company 5, Game Variable1+1000

This way each when Game Variable1 = 1110, at the start of week, then Company ID=2 is not on the map any more. Use a one time event to announce that the company is gone.
When GV1 = 1101, then company ID=3 is not on the map any more. And so on.

GV1 cannot = more than 2 billion and some, so use Game Variable2 for the other AIs.
OilCan

Re: How trigger a set point after you merged with a AI player Unread post

I later realized that my example missed some important details.

To test if AI company ID=2 is gone from the game, then the event would be more than GV1=1110.
The event would be (since there are 4 AI companies)
If GV1=1110 or 1100 or 1000 or 1010 or 110 or 100 or 10 or 0, then ID=2 is gone. One time test.
nedfumpkin

Re: How trigger a set point after you merged with a AI player Unread post

Oilcan: Actually, the event won't work in some circumstances because you need more checking events. in fact, it is 4! ie. 24 possibilities because there are 24 ways that 4 numbers can be arranged.

Therfore, you would need "or" conditions.

GV1=
1011 OR
0011 OR
0001 OR
1001 OR
1010 OR
0000

This way, you get all combinations where the second digit is a 0.

.....

I was also thinking that another possibility would be

Force teest against companies
company ID=2
company assests <0

This way, as soon as a company has no more assets, it will trigger.
Falcen81

Re: How trigger a set point after you merged with a AI player Unread post

Hello,

I've done it I think !*00*!

Really now i still have a lot of testing to do, if all Variables work, made a small test with 8 companies.
Every I time merged I got the message after a week setting. company ID1 showed ID1 merged..
And if i started with ID3 i got message 3.

I did not Use, "Company settings at all.
OilCan wrote:

For AI Company 5, Game Variable1+1000

This way each when Game Variable1 = 1110, at the start of week, then Company ID=2 is not on the map any more. Use a one time event to announce that the company is gone.
When GV1 = 1101, then company ID=3 is not on the map any more. And so on.
and
nedfumpkin wrote:

Force test against companies
company ID=2
company assets <0

This way, as soon as a company has no more assets, it will trigger.
Because the ID is "terminated" after the merge. So the set point will be gone. resulting that the even will NEVER Trigger
i found that out a few days ago.

Also when you bankruptcy a company without assets it's gone.
Does it has assets, you will find it in the merger list, after the merge it's gone. !facepalm!

This gave me a lot of problems, tried a lot of possibilities !hairpull! not working.

:idea: What I did: Use "COMP. STN CONNECT CITY TO CITY". I maybe din't say the map is fully railed up with no more cities without a station, !*00*! My mistake, sorry !facepalm!
With the force test for player and company also

I got one more Company installed, was not necessary, found out later.

I made 19 events, with sub events, if you brought 1 group together. Got 6 groups.

Every Company Has stations, minimum 6, I selected 2. When i Merge the two stations belong to me, which is a trigger point and will give me the message i want.
Only look if the stations are from the same company, or it will not work.

This way i can first buy Company 2,5,7,14,21 in every order I want, and still get the same message. and even if i change as chairman from 3 to 6. it still works if correctly.

After the testing i will confirm that.

Everybody thanks for the help !$th_u$!
OilCan

Re: How trigger a set point after you merged with a AI player Unread post

I'm glad that you found a way to make it work. !!clap!!
User avatar
RulerofRails
Dispatcher
Posts: 310
Joined: Sun Dec 08, 2013 1:26 am

Re: How trigger a set point after you merged with a AI player Unread post

Oilcan's method is good. I'm sure that he did it in his map, but here he forgot to mention that you need to RESET the variable you are using EACH TIME you wish to carry out this check. If you want to check throughout the game you have to check regularly.

For his test to work, GV1 has to be 0 before each test. The way to do this would be with an event.

Side-note: I'm very shy of Temporary Variable setting since it's only reliable for Game Variables. For other types it will reset Variable #1, but all IDs which is pure bug. :cry:

If you order the events correctly, put the reset event FIRST IN THE LIST it can fire at the same time (frequency)
Reset Event
Still have CompanyID#2
Still have CompanyID#3
...

...
Events you want to fire when a specific company is gone. Can be anything. If these are placed LOWER in the list everything can fire at the same time.




"Binary" use of variables is a bit clunky.
The number of OR tests needed is like a pyramid, more at the bottom and less at the top (thanks to </less than).

For 3 uses:
111 Test <111
11 Test#1 <11, Test#2 =/=110
1 Test#1<1, Test#2 =/=110, Test#3 =/=100

Carl Guass formula for sum of integers: (n / 2)(first number + last number).

3 uses takes (3/2)*(1+3) = 6
This is manageable, but be warned that the number of OR tests needed rises rapidly.


4 uses =10
5 uses = 15
etc. .... gets insane pretty quickly.
Post Reply