PDA

View Full Version : Technical questions on scripting



JMRC
06-11-2007, 11:14
Hi.

This weekend I was trying to implement a new feature into EBBS and also change my current money assistance code to reduce the number of monitor_event rules.

However, it didn't work, so I would like your help to understand what I'm doing wrong here:

1. The feature was: when a (named character) general with Despoiler Trait devastates an enemy tile, the general's faction receives some money.

Note: I use the docudemon files as source for the programming rules.

So I started by this code:


monitor_event GeneralDevastatesTile FactionType seleucid
and Trait Despoiler > 0
and AgentType = named character
console_command add_money seleucid, 500
end_monitor

Apparently, it didn't work. Or maybe my concept of "devastating tile" is not correct.


2. Right now, I have the following type of code to implement the money assistance:


;monitor_event 1
monitor_event FactionTurnStart FactionType seleucid
and not FactionIsLocal
and I_TurnNumber < 100
and Treasury > 10000
and Treasury < 20001
console_command add_money seleucid, 10000
end_monitor

;monitor_event 2
monitor_event FactionTurnStart FactionType seleucid
and not FactionIsLocal
and I_TurnNumber < 100
and Treasury < 10001
console_command add_money seleucid, 20000
end_monitor

Now I would like to join it in a single monitor_event. I want to do this because I think that when the monitor_event 2 occurs and the Treasury goes into the range of the monitor_event 1, this last event is triggered, effectively giving 30000 to the faction instead of the intended 20000. Note: I'm not sure of this behavior, but it explains some distortion that I have in the money assistance. I tried to change to the code below, so that the event is only triggered once per turn:



monitor_event FactionTurnStart FactionType seleucid
and not FactionIsLocal
and I_TurnNumber < 100
if Treasury > 10000 and Treasury < 20001
console_command add_money seleucid, 10000
end_if
if Treasury < 10001
console_command add_money seleucid, 20000
end_if
end_monitor

However, this did not work because the Treasury trigger is outside the monitor_event condition. Can someone give me some help with this?

Thanks in advance.

Pharnakes
06-11-2007, 11:18
I think try deleting the agent type = named caharcter, I don't know if it wil improve matters but it certinately won't do any harm, as its not nessecary anyway, as only a general can get the despoiler trait.


2. I'm almost certain this is unessescary provided you make sure the 10000 script is above the 20000 script, beacuse the computer reads down the file and don't think it reads it more than once per turn.

JMRC
06-17-2007, 23:46
Thanks. The previous problem is solved.

Now I have another problem using the GeneralDevastatesTile event to give more money to the looting faction, using the following code, but it doesn't work.



monitor_event GeneralDevastatesTile FactionType seleucid
and SettlementBuildingExists >= farms
console_command add_money seleucid, 100
end_monitor


Seems like this event does not accept the SettlementBuildingExists trigger, although the docudemon file say otherwise.

Can someone give me a hint?

Foot
06-18-2007, 12:52
You cannot have >= with SettlementBuildingExists. You will need to put in "and" statements for all levels of farm you want to use.

Foot

JMRC
06-18-2007, 13:59
You cannot have >= with SettlementBuildingExists. You will need to put in "and" statements for all levels of farm you want to use.

Foot

Thanks Foot. I did try to do that, but it seems the GeneralDevastatesTile event simply doesn't recognize the SettlementBuildingExists trigger. If this is so, then it is a bug in the docudemon files because apparently this event doesn't export the Settlement.

It's a bit frustrating...

BozosLiveHere
06-25-2007, 01:13
You cannot have >= with SettlementBuildingExists. You will need to put in "and" statements for all levels of farm you want to use.

Foot

This is not true. The problem in your code is that AFAIK SettlementBuildingExists can only work if the general is actually inside a settlement, something that just can't happen if he's pillaging a tile.