PDA

View Full Version : player1 presents: Faction Switcher Script



player1
07-27-2005, 18:22
Here is the script that could be useful for swithing game controls to next faction (senate and rebels excluded). Very useful for mod testing purposes. Also it seems it can be used for AIless MP game.

Should be installed in same way as 4 turns per year script file. In fact, every time you need to switch faction you need to manually start the script (similar to 4 tunrs per year script: click F1, then ?, and "show me" button at the end).



script
console_command control slave
if I_LocalFaction romans_julii
console_command control romans_brutii
terminate_script
end_if
if I_LocalFaction romans_brutii
console_command control romans_scipii
terminate_script
end_if
if I_LocalFaction romans_scipii
console_command control macedon
terminate_script
end_if
if I_LocalFaction macedon
console_command control egypt
terminate_script
end_if
if I_LocalFaction egypt
console_command control seleucid
terminate_script
end_if
if I_LocalFaction seleucid
console_command control carthage
terminate_script
end_if
if I_LocalFaction carthage
console_command control parthia
terminate_script
end_if
if I_LocalFaction parthia
console_command control pontus
terminate_script
end_if
if I_LocalFaction pontus
console_command control gauls
terminate_script
end_if
if I_LocalFaction gauls
console_command control germans
terminate_script
end_if
if I_LocalFaction germans
console_command control britons
terminate_script
end_if
if I_LocalFaction britons
console_command control armenia
terminate_script
end_if
if I_LocalFaction armenia
console_command control dacia
terminate_script
end_if
if I_LocalFaction dacia
console_command control greek_cities
terminate_script
end_if
if I_LocalFaction greek_cities
console_command control numidia
terminate_script
end_if
if I_LocalFaction numidia
console_command control scythia
terminate_script
end_if
if I_LocalFaction scythia
console_command control spain
terminate_script
end_if
if I_LocalFaction spain
console_command control thrace
terminate_script
end_if
if I_LocalFaction thrace
console_command control romans_julii
terminate_script
end_if
end_script

player1
07-29-2005, 07:31
Nobody interested?
This could help in making MP script as well as help in testing mods.

P.S.
Why haven't I put this in general forum...

Silver Rusher
07-29-2005, 08:01
Oh My God.

player1, you have cracked the multiplayer campaign code! I mean, the multiplayer campaign if you only use one computer and constantly switch with your opponents, but this is still truly some amazing ground that has been covered.

Thank you so much. Now I can invite all my friends over and show them the might of the Parthian army in action!

One problem I see however: The people you play with on multiplayer will not be able to respond to your diplomacy, unless you switch and become that faction instantly.

I think we and some other people should all team up and make a nice big one computer MP Campaign script. (I'm not sure how well that will work exactly, but it is worth a shot)

Monkwarrior
07-29-2005, 08:02
I think it is very interesting for test purposes.
How I use it?
I suppose that the text must be copied and paste in a txt file, which name? where do I put the file?
Is it possible to change the faction in any moment or only at the end of the turn?
Thanks in advance for the answers. :bow:

player1
07-29-2005, 08:09
Go to the old 4 turns per year thread and see how to set up "show me" script.

That's the way to install it.

wlesmana
07-29-2005, 17:58
This looks great for testing mods. But what happens when you enter battle map sequence? The other side will be controlled by AI?

player1
07-29-2005, 18:05
I guess so...

Heinrich VI
08-02-2005, 17:17
wow! wasn't the problem to switch the factions the main obstacle in creating a mp campaing?. impressive work player1 but i've got one problem - cant find the 4 turns per year thread in order to know how to use it. :embarassed:

anyone got a link ?

GreenBaron
08-02-2005, 22:54
As long as the two players do not intend to attack each other this script should do a great job in setting up a MP camp. Amazing work!

Atheist_Peace
08-03-2005, 01:10
Looks great, i will definitely try this when my good computer isnt messed up anymore.

Heinrich VI
08-04-2005, 12:13
i'd love to give it a try this weekend but i need help setting it up since i can't find the thread about this "4 turns a year script".

Myrddraal
08-04-2005, 16:18
Player 1, what ur doing is great, but its already done...

I worked on an MP campaign for a bit, and getting the script to change factions is already done.

What hasn't been done to finish off the work on the mp campaign is this:

A program in which will generate a historical battle from the armies and co-ordinates
A program which then generates a script to implement the results of that battle

So player 1, like I said ages ago in the mp campaign script, do you want to work with me to finish this off?

player1
08-04-2005, 19:24
Well, the thing is that I can hardly help with these issues.

What they need is real programing, like that 4turns per year generator you made.
At least to generate the script for putting results of the battles back in the campaign map.

And that recording the troops entering the combat and its results would probably need some sort of external "trainer" program.

And I'm not really skilled at that.


As for this script, I must admit that its purpose was not MP play. I needed it to test some changes I done in Bug-Fixer recently, and I needed a way to switch factions to see how they got developed (like what traits AI generals have).

Not to mention that there is a problem with this script, in a way that when faction switch occurs,

AI finishes turn of previous player (so if some units didn't got moved AI will do that).

Corto
08-17-2005, 12:49
Well I also find this script very useful for single player campaigns. What I do is this:

I start out with the romans and unify the whole of Italy. Then I set up my armies on a challeging way, activate the script and save the game with different factions (gaus, illyrians, Iberans, parthia, etc..).

The I decided to give parthia a "push" and left the Romans to the AI. Later on, I might decide to play as the macedons, or any other faction (especially factions that are on a desperate situation).

The possibilities are endless. Variety guaranteed.

For instance, you can play as the romans until you are already in Iberia, or greece, or the east or even gaul, and then change to another faction and fight them.

This is good especially for those guys (like me) that get bored of the middle/late game and like though battles right from the start.

Bartix
08-17-2005, 13:13
Well I also find this script very useful for single player campaigns. What I do is this:

I start out with the romans and unify the whole of Italy. Then I set up my armies on a challeging way, activate the script and save the game with different factions (gaus, illyrians, Iberans, parthia, etc..).

The I decided to give parthia a "push" and left the Romans to the AI. Later on, I might decide to play as the macedons, or any other faction (especially factions that are on a desperate situation).

The possibilities are endless. Variety guaranteed.

For instance, you can play as the romans until you are already in Iberia, or greece, or the east or even gaul, and then change to another faction and fight them.

This is good especially for those guys (like me) that get bored of the middle/late game and like though battles right from the start.
~D ~D
That is brilliant idea!
Also, you can switch for 1 turn to manipulate AI factions when needed, make them ally or become protectorate, declare war on some 3th party ++

sunsmountain
08-17-2005, 13:27
A program in which will generate a historical battle from the armies and co-ordinates
A program which then generates a script to implement the results of that battle

Why would you need this?
and

If this script is so easy to implement, it must be able to play Hot Seat.
- But what happens if you meet the armies of another player?
- Do you have to remove AI factions that are not chosen by players?

Ahhh i think i just understand: The game doesn't allow you to fight one another on the same PC, so you need a historical battle? But that's impossible, you can't exit campaign mode while saving your state, and you can't use the battle generator in the campaign mode as it is hardcoded: You against the AI.

All in all, i'd say that it's possible to play Hot Seat, but your opponents army will always be controlled by the AI, no matter what you do.
In any case, there is no network support for campaign map orders so any battle fought on the same PC would be odd.

Would be fun though: You take Spain, I take Armenia, see who can conquer the most AI settlements first (in the same campaign map).

dark
08-20-2005, 03:00
@Player1
hi, im trying to install your mod, but i need some help
should i just copy your code, in a newly created dersc_script.txt file?

dark89

player1
08-20-2005, 03:34
No, it's installed and used in same way as Myrddraal's 4turns per year script (that thread should have instructions).

dark
08-20-2005, 19:04
Hi, thanks for the help, i managed to install it.
But i ran into a problem. While the script is working correctly, when exit the game i got a error message, that said there was an script error in the descr_script file, line 3, column 1
unrecognized token: Help_Campaign_Keyboard_Shortcuts_Scroll_Thread
I followed the instructions on myrddraal's tread and the script ran fine, so i take that i dont need to follow steps 5 and 7?
check the tread here: Tread (https://forums.totalwar.org/vb/showthread.php?t=44648)

dark89

player1
08-20-2005, 21:50
Exactly...
That part was used to bring advisor up at the start of campaign, and probably has some error anyway.

dark
08-21-2005, 16:20
thanks for the answer

dark89

Duke Malcolm
08-21-2005, 22:57
so could this be implemented into a hot seat game? Would one need to restart RTW everytime the player was changed?

player1
08-22-2005, 16:36
Only thing you need is to start the script when wanting to switch to next player.

RedXIII
12-04-2005, 22:09
I just setup the 4ypt script but what do I do with the script player1 made?

MiniKiller
12-05-2005, 06:02
wow this is sweet i always wished for a 2-8 player campaign offline, like at my house lol

pilatus
12-05-2005, 23:15
this script is really cool
the only BIG! problem: if the human player ends the turn with his local_faction the ai finish his turn and mess up all!
i've just tried out everything to make the script run with the option console_command disable_ai but i don't work!
halt_ai works only with a hot seat mod for 2 factions...
set_ai off is only for the battle map i think...

any ideas of the scripting gods?
would be very cool! :bow:

RedXIII
12-06-2005, 02:19
Can somebody help me set this up? What do I do with his script??

Thanks

pilatus
12-07-2005, 00:43
hey red
if you want the script pm me and i send you the files you need with a short description... ~:cheers:

RedXIII
12-13-2005, 01:29
Will do.