[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: Tutorial campaign



On 20.01.2005 21:57, The Fox wrote:
> > [event structure too small]
> 
> In event.h I read:
> 
>   short e_tdata[3];             // trigger data
>   short e_data[3];              // event data
> 
> It looks like it can be quite easily expanded (with quite destructive 
> effect on backward compatibility). 

That's true. But then you'd also carry around lots of unused slots
for events which don't need the additional data. I think I have a
more generic solution that might come in handy in other situations
as well. I'll add event groups. They will work very similar to
dependencies, ie. you can have one event pointing to another. For
event groups, however, this pointer means that the event that is
pointed to gets disabled and removed when the current event is
executed.

This way you need 9 events for what you want to do, but you need
only those 9 events, and nothing else for disabling the other events.

> > As I explained above there are not enough fields in the program. Of
> > course, we haven't defined the qualifiers either, but that's easy to
> > fix.
> 
> I have an idea for solving (very similar to previous one):
> 
> Have the unit definition as follows: Infantry/3/6 and process it in 
> Execute so that infantry of size 3 and experience 6 (*) is created. Or 
> am I completely wrong?

The parsing part (ie. what is written in the src file) is not
important. We can basically choose any format we like. The
createunit event also already uses the three data slots it has.
But as we seem to be going down the incompatibily road, anyway,
we can just encode several numbers in a single slot so this is going
to be added, too.

> > I'm not sure I understand what you mean. If the createunit event is
> > triggered, why isn't it executed? How do you know it's been 
> triggered?
> > Or are you simply saying the execution order is wrong? If so you can
> > probably fix that by rearranging the events in the proper order in
> > the .src. I'm not entirely sure right now whether the order is 
> stable
> > through saving and loading, but we can make sure it is.
> 
> Well, this was completely my fault. Now I realize that even the order 
> in .src (not just the event id) does matter.

You can't really take the blame for this. It's not documented and
there's no way to adjust the order in CoMET right now... Did you
check that it still works when you save, return to the main menu,
and load the game again? As I said, I'm not sure the event order
is stable when saving/loading.

Jens