Events

Have an idea or great plots for Egoboo? Post them here!

Moderator: Developers

Post Reply
User avatar
bitnapper
Tome Mimic (Module Baker)
Tome Mimic (Module Baker)
Posts: 135
Joined: Fri Jan 30, 2009 3:33 pm
Location: Somewhere near the alps
Contact:

Events

Post by bitnapper »

Events
Positions like Passages, with Scripts belonging to the event.

In this case, there is no object needed to trigger the script. Entering / Leaving the tile(s) is triggering the event.
Two beer or not two beer... rather a malt whisky
User avatar
Zefz
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
Posts: 3820
Joined: Wed Jul 23, 2008 1:27 am
Location: Norway
Contact:

Post by Zefz »

What exactly would an event do? And how exactly would you implement a script for each event?

Some event.txt that defines all events located in the module folder?
User avatar
bitnapper
Tome Mimic (Module Baker)
Tome Mimic (Module Baker)
Posts: 135
Joined: Fri Jan 30, 2009 3:33 pm
Location: Somewhere near the alps
Contact:

Events

Post by bitnapper »

Yes in the

'gamedat'-folder

E.g:

Code: Select all

TopleftXY  BottomrightXY ScriptNo
36 50        37 50            1
An event could be for an example an invisible teleporter, an info-message, spawn surprisingly a monster at a position, initiate the movement of a guard...

I think, the scripts have to be enumerated eg. script1.txt / script2.txt and so on, where the number of the script is the number of the event, because there is no possibility yet to have multiple scripts in the same text file, if I got that right.
Two beer or not two beer... rather a malt whisky
User avatar
Zefz
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
Posts: 3820
Joined: Wed Jul 23, 2008 1:27 am
Location: Norway
Contact:

Post by Zefz »

This is currently handled through objects in the game. Currently there is a moduletool.obj that handles events and boss monsters that handle the rest of the events through passages and their individual scripts.
User avatar
bitnapper
Tome Mimic (Module Baker)
Tome Mimic (Module Baker)
Posts: 135
Joined: Fri Jan 30, 2009 3:33 pm
Location: Somewhere near the alps
Contact:

Events

Post by bitnapper »

Example for usage of events:
There are 10 Braziers on the map. They all use the same object from the object folder (with no script)
For 6 of this braziers there is an event-script based on the braziers position.
4 Braziers are 'for decoration' only

Benefits:
- The brazier has only to be once in the object list, because the event-script is separated from the displayed object (less use of memory / load function)
- Use of objects from the GOR and having an user-defined script for its event
- There is no need to have an object at all for something to happen
- No complicated Link Passage ==> Object ==> Event-Script
Two beer or not two beer... rather a malt whisky
User avatar
Zefz
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
Posts: 3820
Joined: Wed Jul 23, 2008 1:27 am
Location: Norway
Contact:

Post by Zefz »

Hmm true. But it still sounds like events can also use the data from passage.txt

I'm trying to think of a solution that doesn't introduce even more complexity into the game development.
bgbirdsey
{]-[0{0|307 (Developer)
{]-[0{0|307 (Developer)
Posts: 1864
Joined: Wed Jul 23, 2008 4:22 am
Location: Minnesota, USA

Post by bgbirdsey »

Usually what happens is that there are triggers that broadcast a message when someone enters or leaves. We could do that for all passages, make a generic "enter passage #" and "leave passage #" messages.
User avatar
bitnapper
Tome Mimic (Module Baker)
Tome Mimic (Module Baker)
Posts: 135
Joined: Fri Jan 30, 2009 3:33 pm
Location: Somewhere near the alps
Contact:

Further example

Post by bitnapper »

If I want the player to solve the following puzzle:
- He has to light to braziers to open a door

This could be solved with events.
Can it be solved with the actual 'script per object' ?

To make it easier to write such puzzles, it would be handy if there is an array of flags to set / unset, which could be changed / queried by a script.
Two beer or not two beer... rather a malt whisky
User avatar
Zefz
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
Posts: 3820
Joined: Wed Jul 23, 2008 1:27 am
Location: Norway
Contact:

Post by Zefz »

Egoboo uses a IssueOrder system and the IfOrdered to get "variable = selforder" and translates it to what it must do.

Example:

Code: Select all

script a:
IfBumped
  tmpargument = [OPEN]
  IssueOrder

script b:
IfOrdered
  tmpx = selforder
  tmpy = [OPEN]
  IfXIsEqualToY
    DoStuff
Currently braziers handle this with scripts. If they are lighted they open their assigned passage. If the brazier is normal or not depends on its content (also set in spawn.txt).

For example:
If a brazier has content 0 it will act as a normal lighted brazier.
If a brazier has content 1 it will not be lighted and open "selfpassage" when it is lighted.

"selfpassage" is also set in spawn.txt

This means all braziers can share the same generic script:

Code: Select all

IfReaffirmed                 //It got lighted
  tmpargument = 1
  IfContentIs                //Is it a special brazier?
    tmpargument = selfpassage
    OpenPassage           //Open our assigned passage
Post Reply