Log in

View Full Version : Scripting Question



Suraknar
10-07-2005, 23:39
Hello Scripting Gurus!

A small question here about scripting, I went through some Scripting guides here, but I am affraid I am not catching the essence of the reason of scripting...

So I thought to ask directly..

Is it possible to make some behavior happen following a presice action?

For instance, would it be possible to have some province rebel, trigered by the conquest by a certain faction of another province?

Exemple:

lets say that the germans have advanced in to Britain, and captured a couple of provinces, but not the Britons Capital, in subsequent turns the germans advance and lay siege and then capture the Capital of the Britons (the britons still have another province so this does not eliminate their faction)...yet the initially captured Provinces Rebel against their new masters in a last ditch effort to overthrow the germans from their territory and outraged by the capture of their Capital city...

Is it possible to script triggers like that?

Dromikaites
10-08-2005, 08:30
Hello Scripting Gurus!

A small question here about scripting, I went through some Scripting guides here, but I am affraid I am not catching the essence of the reason of scripting...

So I thought to ask directly..

Is it possible to make some behavior happen following a presice action?

For instance, would it be possible to have some province rebel, trigered by the conquest by a certain faction of another province?

Exemple:

lets say that the germans have advanced in to Britain, and captured a couple of provinces, but not the Britons Capital, in subsequent turns the germans advance and lay siege and then capture the Capital of the Britons (the britons still have another province so this does not eliminate their faction)...yet the initially captured Provinces Rebel against their new masters in a last ditch effort to overthrow the germans from their territory and outraged by the capture of their Capital city...

Is it possible to script triggers like that?

It is possible to make most of the things you want but depending on how you want it the code can be very simple or very complicated.

If you want that cities A and B revert to the Britons if city C is conquered and the Brits still have other cities left, then this is not so difficult to script.

If you want that all the cities ever controlled by the Britons (that is, also the Briton conquests, not only their starting cities) to revert back to them in case city C is conquered, this is still possible but you need to create a permanent record of the cities controlled by Britons. You can do that by marking those cities with a special building ("owned_by_britons"). I am not sure if the AI razes buildings so I cannot tell if this method is 100% reliable.

Now you should also keep in mind that the capital location can change. So if you want the revolt to happen when the current capital is conquered, then you need a way to record which is the current capital. If Britons are played by humans then you need a special building ("Capital") and a house rule that says:
1. Build the special building "Capital" in your capital city
2. When you change your capital raze the building from your former capital and build it in the new capital.

Unfortunately this metod can't work if AI plays the Britons.

SigniferOne
10-08-2005, 15:09
I think Dromikaites hit it right on the head: yeah, the idea is very possible (and not that hard to do), given that the assumption that the capital doesn't change.

Suraknar
10-08-2005, 17:43
Ahh Thank you!

Alright lets simplify here. And I appreciate any help in the area of scripting - I am complete Ignorant when it comes to that hehe...

Lets take 3 Cities

A-B-C

How would I go about scripting the condition and triger (what files?), so that when city A is conquered by a specific faction, the cities B and C revert to that Faction?

Thank you much for any help!

Mouzafphaerre
10-08-2005, 21:44
Ahh Thank you!

Alright lets simplify here. And I appreciate any help in the area of scripting - I am complete Ignorant when it comes to that hehe...

Lets take 3 Cities

A-B-C

How would I go about scripting the condition and triger (what files?), so that when city A is conquered by a specific faction, the cities B and C revert to that Faction?

Thank you much for any help!
.
Ahh, reminds me the Heavy War Galleon mutinying and joining Nicholas when he sinks the Frigate off Costa Sinistra. Good mods live many lives. ~;)
.

Suraknar
10-09-2005, 16:21
Hello HB :)

Yes a bit like that I guess, I just want to learn the possibilities of scripting here, if someone is willing to share their knowledge on the subject.

I mean I read the Scripting threads, one lists the triggers, the other tells how to send ready commands to the console. While both are good threads, I see the latter as a way of making custom cheats...which is not bad considering that it is a begining of exploration of what is possible or not, but in both cases I am not knowledgeable enough to turn this information in to something functional in game...in the sence that it is part of the gameplay of a given mod...

Hence, this thread to ask help...