Events

Post bug reports and ask for game support here.
Post Reply
User avatar
AH4Ever
Posts: 628
Joined: Wed Jul 29, 2009 5:30 pm
Location: NU JOYZ

Events

Post by AH4Ever »

What method or methods should be used to have a country surrender, once war is declared?

City.FirePartisans(int cityX, int cityY, int countryID, int unitType, int unitLevel, int unitStrength, name) - Does this create an actual physical unit that can be seen?

JJMC

The next best thing to being clever is being able to quote someone who is.

You weren't there Thursday... You MISSED it!
User avatar
AH4Ever
Posts: 628
Joined: Wed Jul 29, 2009 5:30 pm
Location: NU JOYZ

RE: Events

Post by AH4Ever »

ORIGINAL: AH4Ever

What method or methods should be used to have a country surrender, once war is declared?

Trial and error, mostly error. I tried several approaches that I thought would work and got close each time. Finally I realized I forgot to declare war. Whoops!




Also along the way I got a few of these:





Image
Attachments
001.jpg
001.jpg (145.93 KiB) Viewed 112 times
JJMC

The next best thing to being clever is being able to quote someone who is.

You weren't there Thursday... You MISSED it!
User avatar
Bleck
Posts: 741
Joined: Sun Mar 08, 2009 1:35 pm
Location: Poland
Contact:

RE: Events

Post by Bleck »

%% fixed
Wastelands Interactive member (Programmer)
User avatar
AH4Ever
Posts: 628
Joined: Wed Jul 29, 2009 5:30 pm
Location: NU JOYZ

RE: Events

Post by AH4Ever »

Clarification Please:

METHOD:
Flag.GetValue
DESCRIPTION:
Returns the value of given flag.

When using this to check on an event that has options, it seems to me that it only returns that the event occurred or not. There is no way to see if a particular option within the event triggered.

JJMC

The next best thing to being clever is being able to quote someone who is.

You weren't there Thursday... You MISSED it!
User avatar
Bleck
Posts: 741
Joined: Sun Mar 08, 2009 1:35 pm
Location: Poland
Contact:

RE: Events

Post by Bleck »

You need to set/change value of flag when particular option is triggered. You can use "Flag.SetValue" or "Flag.ChangeValue".
<event eventID="5678" ...>
...
<condition>
<and>
<!--Option 3 in event 1234-->
<expression>
<leftOperand method="Flag.GetValue" param0="1234"/>
<operator value="equals"/>
<rightOperand constValue="3"/>
</expression>
</and>
</condition>
<options>

<option optionID="1" ...>
...
<effects>
...
<effect method="Flag.SetValue" param0="5678" param1="1"/>
</effects>
</option>

<option optionID="2" ...>
...
<effects>
...
<effect method="Flag.SetValue" param0="5678" param1="2"/>
</effects>
</option>

</options>
</event>

After this you can read value of flag "5678" to know what option was chosen.
Wastelands Interactive member (Programmer)
User avatar
AH4Ever
Posts: 628
Joined: Wed Jul 29, 2009 5:30 pm
Location: NU JOYZ

RE: Events

Post by AH4Ever »

It seems you have given us several ways to accomplish the same thing.

From ai_data comments:

DesiredTechLevels - then list of 7 integers -
this describes technology levels in 6 fields that AI will try to achieve.
1 = artillery
2 = tanks
3 = NOT USED
4 = airplanes
5 = submarines
6 = naval units
7 = nuclear bomb

NOTE: do not set levels to more than 5
last field (ie nuclear bomb) can be set to 0 or 1 only.
Default is (1,1,1,1,1,1,0).


Event Engine Methods:

METHOD:
AI.SetDesiredTechLevel (int countryID, int techID, int desiredLevel)

DESCRIPTION:
Sets desired level of given technology for AI of given country.
Only when desired tech level is greater than current level AI will spend PP on research.
This method is very important, using it is the only way to make the AI do any research!
Current levels of technology can be checked in countries.csv, desired levels of techs are in
ai_data.csv.

techID parameters:
0: artillery
1: tanks
2: not used anymore...
3: combat aircrafts
4: submarines
5: naval units
6: nuclear weapons

It appears that the above is a process where the AI will spend PP's


METHOD:
Country.SetTechLevel (int countryID, int TechType, int Value)

DESCRIPTION:
Sets tech level of given tech type for given country.

This last one is the one you chose to use for the event .xml's
and it would seem that it is an immediate change yet you give the event
a range of a year with the begin & end dates.



Is one somehow a better choice than another?

JJMC

The next best thing to being clever is being able to quote someone who is.

You weren't there Thursday... You MISSED it!
User avatar
doomtrader
Posts: 5319
Joined: Tue Jul 22, 2008 5:21 am
Location: Poland
Contact:

RE: Events

Post by doomtrader »

Depends how you want to manage AI.
First option is of course most costly for the AI and gives more what if feeling to the game. The AI can be able or not to enter into higher level.
Second option gives more historical gameplay, as you are simply setting when AI will get new technology, no matter how well it's playing.
User avatar
AH4Ever
Posts: 628
Joined: Wed Jul 29, 2009 5:30 pm
Location: NU JOYZ

RE: Events

Post by AH4Ever »

ORIGINAL: doomtrader

Depends how you want to manage AI.

First option is of course most costly for the AI and gives more what if feeling to the game.

I'm glad I cleared that up with you I was just about to start modding your AI TECH events, thinking that it might be a necessary thing.
JJMC

The next best thing to being clever is being able to quote someone who is.

You weren't there Thursday... You MISSED it!
Post Reply

Return to “Tech Support”