This is probably the most difficult part to set up as there are many variables and what they mean changes based on the event being scripted. Some variables are not even used in some events.** NOTE
: I've done very little with the Scripted Events myself, it is very possible I'll make mistakes here...
I'll start with a small example and post more later.
In the &&SEVENTS section add the following line;
0, 0, 8, , 105, 154, False, False, False, False, False, 1, 0, 0, , , , , ,
This will make Western Sahara surrender to the Caliphate before time even rolls. You won't even see the surrender message. What this will do is the Caliphate will own the territory but it will still show as loyal to Western Sahara and cause a loyalty penalty in those hexes. The following values are used in variable order as defined on the wiki
0 - eventtime: we made this zero so it happens immediatly.
0 - eventtimewind: we also made this zero so it happens immediatly. explained later.
8 - eventid: As listed for #8, this is a Surrender/Elimination type event
<blank> - eventparam: As there are no parameters for a "Type 8" event, this is just blank.
105 - eventdbregion: This is the Region ID as found in the .CVP relations file of the region being affected, the one which will surrender.
154 - eventotherdbregion: This is the Region ID as found in the .CVP relations file of the target region, the one to wich the "eventdbregion" surrenders
False - eventbnotally: Setting for "Don't trigger event if eventotherdbregion is an allied region
False - eventbnotneutral: Setting for "Don't trigger event if eventotherdbregion is a Neutral region
False - eventbnotwary: Setting for "Don't trigger event if eventotherdbregion is an enemy region
False - eventbnotifhuman: Setting for "Don't trigger event if eventdbregion = human player
False - eventbnotifotherhu: Setting for "Don't trigger event if eventotherdbregion = human player
1 - eventparami0: As noted for a "Type 8", this will make the two regions "Group/Unify"
0 - eventparami1: As noted for a "Type 8", this will make the loyalty of eventdbregion stay the same
0 - eventparami2: As noted for a "Type 8", this will mean that eventotherdbregion does not get the research known by eventdbregion
There are no other parameters definded for a Type 8 event, so the rest are blank.
That took me quite a while to put together so I'll stop at that tonight, more again soon.