> For the complete documentation index, see [llms.txt](https://docs.settlers-united.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.settlers-united.com/s4-lua-api-de/library-functions/global-functions/request_event.md).

# request\_event

## `request_event(Funktion, Eventtyp)`

Jede Funktion, die vom Spiel selbst aufgerufen wird, muss hier angefordert werden. Dies wird meist in new\_game() erledigt. Mögliche [Events ](/s4-lua-api-de/api-enums/events.md)sind:

|                                               |                                                                                                  |
| --------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| Events.TICK                                   | Funktion wird jeden Tick aufgerufen                                                              |
| Events.FIVE\_TICKS                            | Funktion wird alle fünf Ticks aufgerufen                                                         |
| Events.VICTORY\_CONDITION\_CHECK              | ähnlich wie FIVE\_TICKS, aber nur, solange das Spiel nicht gewonnen oder verloren wurde          |
| Events.FIRST\_TICK\_OF\_NEW\_OR\_LOADED\_GAME | <p>Beim Starten oder neu laden eines Spiels<br>(nach Events.FIRST\_TICK\_OF\_NEW\_GAME)</p>      |
| Events.FIRST\_TICK\_OF\_NEW\_GAME             | Beim Starten eines neuen Spiels.                                                                 |
| Events.PRODUCTION                             | unbekannt, vermutlich wenn ein Produktionsvorgang beendet wurde.                                 |
| Events.SPACE                                  | unbekannt                                                                                        |
| Events.BUILD\_PRIO                            | unbekannt, vermutlich wenn die Gebäudepriorität geändert wird                                    |
| Events.CREATE\_FOUNDATION\_CART               | unbekannt, vermutlich beim erstellen eines Gründungskarrens.                                     |
| Events.CRUSH\_BUILDING                        | unbekannt, vermutlich wenn ein Gebäude abgerissen wird                                           |
| Events.SHOW\_WORK\_AREA                       | unbekannt, vermutlich wenn der Spieler sich den Arbeitsbereich eines Gebäudes zeigen lässt       |
| Events.MAGIC\_SPELL\_CAST                     | unbekannt, vermutlich wenn ein Spieler einen Zauber nutzt                                        |
| Events.ZOOM\_FACTOR\_CHANGED                  | unbekannt, vermutlich wenn der Spieler den Zoom verstellt                                        |
| Events.WARRIOR\_SENT                          | unbekannt, vermutlich wenn ein Spieler einer Einheit einen Bewegungsbefehl erteilt               |
| Events.WORK\_AREA                             | unbekannt, vermutlich wenn ein Spieler einen Arbeitsbereich neu festlegt                         |
| Events.MENUCLICK                              | unbekannt, vermutlich wenn der Spieler im Menü klickt                                            |
| Events.GOODARRIVE                             | unbekannt, vermutlich wenn ein Siedler eine Ware an ihr Ziel bringt                              |
| Events.WORK\_STATUS                           | unbekannt                                                                                        |
| Events.SETTLER\_CHANGE\_TYPE                  | unbekannt, vermutlich wenn ein Siedler die Rolle wechselt                                        |
| Events.COMMAND                                | unbekannt                                                                                        |
| Events.DRAG\_BUILDING                         | unbekannt, vermutlich wenn der Spieler sich die möglichen Bauplätze für ein Gebäude zeigen lässt |

#### Rückgabewert

none

#### Beispiel

```lua
... Funktion Beispiel und VictoryConditionCheck werden hier geschrieben ...

function new_game()
        request_event(VictoryConditionCheck, Events.VICTORY_CONDITION_CHECK)
        request_event(Beispiel, Events.FIVE_TICKS)
end
function register_functions()
        reg_func(VictoryConditionCheck)
        reg_func(Beispiel)
end
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.settlers-united.com/s4-lua-api-de/library-functions/global-functions/request_event.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
