Trigger
Classes¶
Trigger
¶
Bases: AoE2Object
, TriggerComponent
Object for handling a trigger.
Source code in AoE2ScenarioParser/objects/data_objects/trigger.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 |
|
Attributes¶
conditions: List[Condition]
property
writable
¶
List[Condition]
All conditions in this trigger
display_as_objective: int = display_as_objective
instance-attribute
¶
int
Value:
display_as_objective
new_condition: NewConditionSupport = NewConditionSupport(self)
instance-attribute
¶
NewConditionSupport
Value:
NewConditionSupport(self)
new_effect: NewEffectSupport = NewEffectSupport(self)
instance-attribute
¶
NewEffectSupport
Value:
NewEffectSupport(self)
short_description_stid: int = short_description_stid
instance-attribute
¶
int
Value:
short_description_stid
Functions¶
def __init__(...)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
- | required |
description |
str
|
- |
''
|
description_stid |
int
|
- |
-1
|
display_as_objective |
int
|
- |
0
|
short_description |
str
|
- |
''
|
short_description_stid |
int
|
- |
-1
|
display_on_screen |
int
|
- |
0
|
description_order |
int
|
- |
0
|
enabled |
int
|
- |
1
|
looping |
int
|
- |
0
|
header |
int
|
- |
0
|
mute_objectives |
int
|
- |
0
|
conditions |
List[Condition]
|
- |
None
|
condition_order |
List[int]
|
- |
None
|
effects |
List[Effect]
|
- |
None
|
effect_order |
List[int]
|
- |
None
|
trigger_id |
int
|
- |
-1
|
kwargs |
? | - |
{}
|
Source code in AoE2ScenarioParser/objects/data_objects/trigger.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
|
def __str__(...)
¶
Source code in AoE2ScenarioParser/objects/data_objects/trigger.py
388 389 |
|
def get_condition(...)
¶
Retrieve a condition based on its (display) index
Parameters:
Name | Type | Description | Default |
---|---|---|---|
condition_index |
int
|
The condition index of the condition to retrieve |
None
|
display_index |
int
|
The display index of the condition to retrieve |
None
|
Raises:
Type | Description |
---|---|
ValueError
|
If more than one parameter is used simultaneously |
IndexError
|
If the condition could not be found |
Returns:
Type | Description |
---|---|
Condition
|
The wanted condition |
Source code in AoE2ScenarioParser/objects/data_objects/trigger.py
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 |
|
def get_content_as_string(...)
¶
Create a human-readable string showcasing all content of this trigger. This includes all the content within the conditions and effects of this trigger.
This is also the function that is called when doing: print(trigger)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
include_trigger_definition |
bool
|
If the trigger meta-data should be added by this function |
False
|
Returns:
Type | Description |
---|---|
str
|
The created string |
Source code in AoE2ScenarioParser/objects/data_objects/trigger.py
318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 |
|
def get_effect(...)
¶
Retrieve an effect based on its (display) index
Parameters:
Name | Type | Description | Default |
---|---|---|---|
effect_index |
int
|
The effect index of the effect to retrieve |
None
|
display_index |
int
|
The display index of the effect to retrieve |
None
|
Raises:
Type | Description |
---|---|
ValueError
|
If more than one parameter is used simultaneously |
IndexError
|
If the effect could not be found |
Returns:
Type | Description |
---|---|
Effect
|
The wanted effect |
Source code in AoE2ScenarioParser/objects/data_objects/trigger.py
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 |
|
def remove_condition(...)
¶
Remove a condition from this trigger
Parameters:
Name | Type | Description | Default |
---|---|---|---|
condition_index |
int
|
The condition index of the condition to remove |
None
|
display_index |
int
|
The display index of the condition to remove |
None
|
condition |
Condition
|
A reference to the condition object to remove from this trigger |
None
|
Raises:
Type | Description |
---|---|
ValueError
|
If more than one parameter is used simultaneously |
Source code in AoE2ScenarioParser/objects/data_objects/trigger.py
294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 |
|
def remove_effect(...)
¶
Remove an effect from this trigger
Parameters:
Name | Type | Description | Default |
---|---|---|---|
effect_index |
int
|
The effect index of the condition to remove |
None
|
display_index |
int
|
The display index of the condition to remove |
None
|
effect |
Effect
|
A reference to the effect object to remove from this trigger |
None
|
Raises:
Type | Description |
---|---|
ValueError
|
If more than one parameter is used simultaneously |
Source code in AoE2ScenarioParser/objects/data_objects/trigger.py
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 |
|