Maximum Functions?

NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Forum rules
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Locked
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Maximum Functions?

Post by Knight Captain »

What's the maximum number of functions in Exult? SI Fixes has the autonumbering starting at 0xC00.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: Maximum Functions?

Post by Knight Captain »

Another question for Marzo: How can I use a usecode array or script block to move something a tile in a direction? I don't want to step_e or similar, because that changes the frame.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: Maximum Functions?

Post by Knight Captain »

Are the spells hard-coded to handle removing the reagents from the Avatar?

Looking at the spell code it appears that the game engine does this rather than Usecode. So it's not possible, for example, to take out a spell and replace it with one that use different reagents.

There also doesn't appear to be a check that looks for the ring of reagents in these spells.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: Maximum Functions?

Post by Knight Captain »

5426 (0x1532) worked in a very brief test today.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: Maximum Functions?

Post by Knight Captain »

How do I create an egg via Usecode and set all the parameters?

I want to create an egg that will need to use external criteria, but only trigger at a short distance. And some weather eggs that function on external criteria.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: Maximum Functions?

Post by Knight Captain »

Donfrow
Posts: 308
Joined: Thu May 14, 2020 1:34 pm

Re: Maximum Functions?

Post by Donfrow »

Is that used in a script block on the egg usecode?

ie,

script item
{
setegg 1, 5
}

And then whatever you want to do with the egg us outside of the script block?

Scripting is a really big mystery to me even reading over the scripting reference pages.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: Maximum Functions?

Post by Knight Captain »

Yes. I believe the egg has to be created as a shape first, then modified via a script block. That should assign some other Usecode to the egg.

How to have it do basic things like weather, spawn monsters, and things that do not call another Usecode function is not clear to me.

As part of digging into the original SI Usecode I documented everything I could. Only byte(0x02) remains unknown, and it is only used once. None of this is posted yet though.
Donfrow
Posts: 308
Joined: Thu May 14, 2020 1:34 pm

Re: Maximum Functions?

Post by Donfrow »

So this isn't done use the create egg tool in Exult Studio, and then on the usecode assigned to that egg.

If I'm understanding correctly, you could create a shape, lets say a rock shape 1000, then on the usecode for that object shape, in the script use the setegg, which would make it have egg properties, similar to creating it through the Exult Studio create egg tool?

All the eggs I've done up until this point were eggs created in Exult Studio that are assigned a usecode function, and then in that usecode function do whatever I wanted the egg to do, like create monsters with equipment, etc.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: Maximum Functions?

Post by Knight Captain »

It looks like most (all?) Usecode eggs are pre-placed on the map, and then only trigger when the coded conditions are met. But since map editing is so fraught with potential trip-ups, I'd rather do it via Usecode.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: Maximum Functions?

Post by Knight Captain »

UI_set_usecode_fun does not work for setting an egg's function. That's probably intentional, as the original game does not seem to have a way to create and set a new egg. So they had to be placed via some map editing tool.

I've submitted a feature request here:
https://sourceforge.net/p/exult/feature-requests/190/

Usecode cannot be attached to a specific shape, generally, without it applying to all of that same shape. Eggs and barges are special cases, in that they should allow for some specific instance manipulation.
Donfrow
Posts: 308
Joined: Thu May 14, 2020 1:34 pm

Re: Maximum Functions?

Post by Donfrow »

I see what you mean now. I didn't quite grasp that you wanted to do it without having to edit the map at all.

Interesting information to know, but seems too complicated for my simple mind to fully grasp!
Locked