Студио Витоша | Vitosha Studio


collapse collapse

* Форум | Forum

You know where the safety valve will be by Gamerzone
[November 16, 2019, 03:05:46 AM]


There'll be a slew of 2K players by Gamerzone
[November 16, 2019, 03:03:26 AM]


Мобилна интеграция на сайта by Sentinel
[October 24, 2019, 11:47:16 AM]


Redesign of the site by kohai
[October 24, 2019, 11:36:27 AM]


Виц на деня by BobbyImisp
[August 30, 2019, 02:49:36 PM]

Устройство и начин на програмиране

0 Members and 1 Guest are viewing this topic.

Offline bratignat

  • Our creations today, are your tomorrow dreams
  • Админ | Admin
  • Редовен | Regular
  • *
  • Tzar of Vitosha
    • View Profile
    • Vitosha Studio
Както обясних в предишна тема, идеята ми относно проекта The Wolves II - Sendy е повече хора да разберат, как точно се прорамира играта. По този начин, ще има много и разнообразни идеи за обновяването й, които всеки ще може да използва.

Затова тук ще публикувам нещо, като азбука на програмирането в EU III.

Основното нещо, което трябва да знаем за Europa Universalis III, е че тя се състои от променяща се и неизменяща се част, Неизменящата се част е онова, което фединира играта, когато я започваме. Това са например фаиловете, които  определят, кой владее дадена провинция в конкретна година. Динамичната част се състои от събития и решения (events & decisions). Ако приемем неизменящата се част за снимка на картата на света, единствения, начин да изменяте нещо, щом веднъж сте започнали играта е като играете или като използвате решения или събития.

Променливата част се състои от събития и решения. Събитията се намират в EU3\event, а решенията в  EU3\decisions. Езикът, на който са написани решенията и събитията, като цяло е еднакъв с много малки изключения.

Събитията имат следните характеристики - те се случват тогава и само, тогава, когато са изпълнени всички условия дефинирани в тях, за да се случат. За разлика от събитията, решенията имат двустепенен механизъм, който ги осъществява - те имат и потенциал, освен условия, които се изисква да се случат.

Частта от събитията и решенията, която дефинира, кога ще се случат или е възможно да се случат се нарича trigger (спусък). Когато условията дефинирани в trigger частта са налице, събитието или решението се "изтрелват" (случва).

В събитията и случаите има още две важна части, една от които се нарича scope. Scope или обхват частта, определя, какво точно засяга събитието или решението - държава, група държави, провинции, владетели. Или кой ще "пострада" от случването на събитието/решение.

Последната трета част от събитията и решенията се нарича -effect. Ефектът е самото действие. Да речем, преминаването ан една провинция от владение на една държава в фруга, сменяте на религията й, избухването на война между държави, наследяване и т.н.


Code: [Select]
Effects

COUNTRY SCOPE:

EU3 1.3:

treasury
Deduct/add money to the country’s treasury.
Scope: country
Syntax: treasury = x ( x = +-1..)

prestige
Increase/decrease the amount of prestige the country has.
Scope: country
Syntax: prestige = x ( x = +-0..1)


inflation
Increase/decrease the country’s inflation.
Scope: country
Syntax: inflation = x ( x = +-1..)

stability
Increase/decrease the country’s stability.
Scope: country
Syntax: stability = x (x = -3..3)

war_exhaustion
Increase/decrease the amount of war exhaustion a country has.
Scope: country
Syntax: war_exhuastion = x (x = +-1..10)

manpower
Increase/decrease the amount of manpower a country has.
IN NOMINE 3.1: if x is between -0.999 and +0.999, it means the percentage of the maximum manpower of the country.
Scope: country
Syntax: manpower = x (x = +-0..1)

army_tradition
Increase/decrease the country’s army tradition.
Scope: country
Syntax: army_tradition = x (x = +-0..1)

navy_tradition
Increase/decrease the country’s naval tradition.
Scope: country
Syntax: navy_tradition = x (x = +-0..1)

badboy
Increase/decrease the country’s reputation-value.
Scope: country
Syntax: badboy = x (x = +- 1..)


capital
Move the capital to a new province.
Scope: country
Syntax: capital = province id

religion
Change a country’s religion.
Scope: country
Syntax: religion = religion type/THIS

enable_religion
Enable a certain religion.
Scope: country
Syntax: enable_religion = religion type

add_core
Make a certain province the country’s core.
Scope: country
Syntax: add_core = province id/THIS

remove_core
Loose an existing core on a province.
Scope: country
Syntax: remove_core = province id

primary_culture
Change the country’s primary culture.
Scope: country
Syntax: primary_culture = culture name/THIS

add_accepted_culture
Make a certain culture accepted by the country.
Scope: country
Syntax: add_accepted_culture = culture name/THIS

remove_accepted_culture
Remove an accepted culture from the country.
Scope: country
Syntax: remove_accepted_culture = culture name

elector
Add/remove an elector.
Scope: country
Syntax: elector = yes/no

add_idea
Give the country a new idea.
Scope: country
Syntax: add_idea = name of idea

remove_idea
Remove an existing idea from the country.
Scope: country
Syntax: remove_idea = name of idea

government
Change the current form of government for the country.
Scope: country
Syntax: government = government type

change_tag
Transform the country into a new nation.
Scope: country
Syntax: change_tag = country tag

technology_group
Allow the country to change technology group for better or for worse.
Scope: country
Syntax: technology_group = latin/eastern/muslim/indian/chinese/
african/new_world

add_country_modifier
Add a country modifier with certain effects to the country.
Scope: country
Syntax: add_country_modifier = name of modifier

set_country_flag
Set a flag for the country to indicate that certain criteria have been met.
Scope: country
Syntax: set_country_flag = name of flag

clr_country_flag
Remove a country flag.
Scope: country
Syntax: clr_country_flag = name of country flag

missionaries
Increase/decrease the number of missionaries that are available to the country.
Scope: country
Syntax: missionaries = x (x = +-1..5)

merchants
Increase/decrease the number of merchants that are available to the country.
Scope: country
Syntax: merchants = x (x = +-1..5)

colonists
Increase/decrease the number of colonists that are available to the country.
Scope: country
Syntax: colonists = x (x = +-1..5)

spies
Increase/decrease the number of spies that are available to the country.
Scope: country
Syntax: spies = x (x = +-1..5)

diplomats
Increase/decrease the number of diplomats that are available to the country.
Scope: country
Syntax: diplomats = x (x = +-1..5)

discover
Allow a country to discover a certain province.
Scope: country
Syntax: province id = { discover = yes }

casus_belli
Give another country a casus belli on the current country.
Scope: country
Syntax: random_country = { casus_belli = THIS }
Syntax: any_neighbor_country = { casus_belli = THIS }

add_casus_belli
Give the current country a casus belli on another country.
Scope: country
Syntax: random_country = { add_casus_belli = THIS }
Syntax: any_neighbor_country = { add_casus_belli = THIS }

relation
Improve/Worsen relations between two countries. If this is used the scope has to be changed first so that the effects applies to both the current country and some other state.
Scope: country
Syntax: relation = { who = country tag/THIS value = x }

secede_province
Cede a specific province to the specified country.
Scope: country
Syntax: province id = { secede_province = country tag }

inherit
Allow the country to inherit the specified country.
Scope: country
Syntax: inherit = country tag

release
Allow the country to release the specified country and thereby create a new independent nation.
Scope: country
Syntax: release = country tag

remove_advisor
Remove an advisor from the country’s court.
Scope: country
Syntax: remove_advisor = advisor type

war
Start a war between the current country and the specified state.
Scope: country
Syntax: war = country tag

loan_size
Increase/decrease the loan size that is set for the country.
Scope: country
Syntax: loan_size = x (x = +-1..)

policies
Move the policy slider the specified amount of steps.
Scope: country
Syntax: p = x (x = +-1..5)
(p = aristocracy_plutocracy/
centralization_decentralization/
innovative_narrowminded/
mercantilism_freetrade/
offensive_defensive/
land_naval/
quality_quantity/
serfdom_freesubjects)

technology
Invest a certain amount of money into the specified technology.
IN NOMINE 3.1: if x is between -0.999 and +0.999, it means the percentage of the current cost for that technology.
Scope: country
Syntax: t = x (x = +-1..)
(t = land_tech
naval_tech
trade_tech
production_tech
government_tech)


Napoleon’s Ambition:

set_revolution_target
Makes the current country a revolution target.
Scope: country
Syntax: set_revolution_target = this / from / tag

country_event
Triggers the specified country event for the current country.
Scope: country
Syntax: country_event = event_id

remove_country_modifier
Removes a certain country modifier from the current country.
Scope: country
Syntax: remove_country_modifier = name of modifier

create_marriage
Creates a royal marriage with another country.
Scope: country
Syntax: create_marriage = this / from / tag

create_alliance
Creates an alliance with another country.
Scope: country
Syntax: create_allieance = this / from / tag

create_admiral
Creates a random admiral that will be equivalent to one generated with the given amount of tradition.
Scope: country
Syntax: create_admiral = amount of tradition (0-100)

create_explorer
Creates a random explorer that will be equivalent to one generated with the given amount of tradition.
Scope: country
Syntax: create_explorer = amount of tradition (0-100)

create_conquistador
Creates a random conquistador that will be equivalent to one generated with the given amount of tradition.
Scope: country
Syntax: create_conquistador = amount of tradition (0-100)

create_general
Creates a random general that will be equivalent to one generated with the given amount of tradition.
Scope: country
Syntax: create_general = amount of tradition (0-100)

define_admiral
Creates an admiral with the given name and stats.
Scope: country
Syntax: define_admiral = {
name = "name"
shock = num
fire = num
siege = num
maneuver = num
}

define_explorer
Creates an explorer with the given name and stats.
Scope: country
Syntax: define_explorer = {
name = "name"
shock = num
fire = num
siege = num
maneuver = num
}

define_conquistador
Creates a conquistador with the given name and stats.
Scope: country
Syntax: define_conquistador = {
name = "name"
shock = num
fire = num
siege = num
maneuver = num
}

define_general
Creates a general with the given name and stats.
Scope: country
Syntax: define_general = {
name = "name"
shock = num
fire = num
siege = num
maneuver = num
}

define_ruler
Creates a new ruler with the given name and stats.
Scope: country
Syntax: define_ruler = {
name = "name"
regent = yes / no
female = yes / no
DIP = num
MIL = num
ADM = num
}

remove_merchant
Removes a merchant from a random COT.
Scope: country
Syntax: remove_merchant = this / from / random / tag

add_merchant
Adds a merchant to a random COT.
Scope: country
Syntax: add_merchant = this / from / random / tag

kill_ruler
Kills a ruler.
Scope: country
Syntax: kill_ruler = “name” / this

kill_leader
Kills a leader.
Scope: country
Syntax: kill_leader = “name” (random does not work)

release_vassal
Allow the country to release the specified country as a vassal.
Scope: country
Syntax: release_vassal = this / from / random / tag


In Nomine:

set_variable
Creates a new variable and assigns it the specified value.
Scope: country
Syntax: set_variable = {
which = variable_name
value = x (x = +-1..)
}

change_variable
Increases or decreases the value of an existing variable.
Scope: country
Syntax: change_variable = {
which = variable_name
value = x (x = +-1..)
}

random
Adds an x percent chance that a given effect will trigger. If the x% is not met, nothing will happen. So for instance it allows to have an event that MAY lower stability, but also may be innocuous.
Scope: country
Syntax: random = {
chance = x
[effect] (f.ex: stability = -1)
     }

random_list
Allows to have an event where any of a number of things can happen, depending on the odds given. For instance, a 50/50 chance of either a loss of stability or a rebellion right there and then.
Scope: country
Syntax: random_list = {
[odds1] = { [effect1] }
[odds2] = { [effect2] }

}

Example: random_list = {
50 = { owner = { stability = -1 } }
50 = { anti_tax_rebels = 1 }
}

set_global_flag
Creates a global flag for all countries.
Scope: global
Syntax: set_global_flag = name of global flag

create_advisor
Creates a random advisor. NEEDS TESTING
Scope: country
Syntax: create_advisor = ????


define_advisor
Creates an advisor of the given type and stats.
Scope: country
Syntax: define_advisor = {
name = “advisor name”
type = type of advisor (statesman…)
skill = num
}

remove_fow
Removes the target country's fog of war for the country that receives the event so he can see everything in the given country for a period of x months. Not sure if it works with events, it only appears in common\spies.txt in vanilla.
Scope: country
Syntax: remove_fow = x


Code: [Select]
Scopes
Several commands can change scope. Whenever the scope is changed, every effect from then on will refer to the new country or province.  Some effects accept a THIS as an argument, which refers to the country or province that received the event.

COUNTRY SCOPE:

EU3 1.3:

ally
Changes the current scope to any allied country.
Scope: country
Syntax: ally = { effects… }

any_country
Changes the current scope to any available countries.
Scope: country
Syntax: any_country = { effects… }

random_country
Changes the current scope to any available country.
Scope: country
Syntax: random_country = { effects… }

emperor
Changes the current scope to the emperor.
Scope: country
Syntax: emperor = { effects… }

controller
Changes the current scope from the current province to the country that controls it.
Scope: country
Syntax: controller = { effects… }

owner
Changes the current scope from the current province to the country that owns it.
Scope: country
Syntax: owner = { effects… }

[country tag]
Changes the current scope to a specific country, chosen by its tag.
Scope: country
Syntax: [TAG] = { effects… }


Napoleon’s Ambition:

FROM
Changes the current scope to the country that triggered the current event.
Scope: country
Syntax: FROM = { effects… }

revolution_target
Changes the current scope to a country that has been chosen as a revolution target..
Scope: country
Syntax: revolution_target = { effects… }

local_enemy
Changes the current scope from the current province to an enemy country with troops in it.
Scope: country
Syntax: local_enemy = { effects… }

any_neighbor_country
Changes the current scope to any available neighboring countries.
Scope: country
Syntax: any_neighbor_country = { effects… }

overlord
Changes the current scope either to the senior partner in a PU with the current country or to its overlord if it’s a vassal.
Scope: country
Syntax: overlord = { effects… }


In Nomine 3.0:

crusade_target
Changes the current scope to the country currently targeted by a crusade.
Scope: country
Syntax: crusade_target = { effects… }

any_elector
Changes the current scope to any elector in the HRE.
Scope: country
Syntax: any_elector = { effects… }


In Nomine 3.1:

rival_countries
Changes the current scope to any rival country.
Scope: country
Syntax: rival_countries = { effects… }



threat_countries
Changes the current scope to any country that is currently perceived as a threat.
Scope: country
Syntax: threat_countries = { effects… }
PROVINCE SCOPE:

EU3 1.3:

capital_scope
Changes the current scope from the current country to its capital.
Scope: province
Syntax: capital_scope = { effects… }

random_owned
Changes the current scope from the current country to any owned province.
Scope: province
Syntax: random_owned = { effects… }

any_neighbor_province
Changes the current scope to any neighboring province.
Scope: province
Syntax: any_neighbor_province = { effects… }

[province ID]
Changes the current scope to a specific province, chosen by its ID number.
Scope: province
Syntax: [ID] = { effects… }




Napoleon’s Ambition:

any_owned
Changes the current scope from the current country to any owned provinces, and affects them all.
Scope: province
Syntax: any_owned = { effects… }

random_center_of_trade
Changes the current scope from the current country to any province with a COT (only the ones that you own or any of them?).
Scope: province
Syntax: random_center_of_trade = { effects… }

heretic
Changes the current scope to a province with a religion different from the state religion.
Scope: province
Syntax: heretic = { effects… }

random_empty_neighbor_province
Changes the current scope to any empty neighboring province.
Scope: province
Syntax: random_empty_neighbor_province = { effects… }




In Nomine 3.0:

[region name]
Needs to be tested to make sure, but I guess it changes the scope to a province in the specified region.
Scope: province
Syntax: [region name] = { effects… }

« Last Edit: January 16, 2019, 03:52:17 PM by bratignat »


 

* Галерия | Gallery

Rome

Views: 519
By: bratignat