Page 1 of 1

Maximum Functions?

Posted: Fri Feb 17, 2017 8:24 am
by Knight Captain
What's the maximum number of functions in Exult? SI Fixes has the autonumbering starting at 0xC00.

Re: Maximum Functions?

Posted: Fri Feb 24, 2017 2:09 pm
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.

Re: Maximum Functions?

Posted: Fri Feb 24, 2017 3:03 pm
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.

Re: Maximum Functions?

Posted: Fri Mar 10, 2017 1:26 pm
by Knight Captain
5426 (0x1532) worked in a very brief test today.

Re: Maximum Functions?

Posted: Thu Mar 16, 2017 8:50 pm
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.

Re: Maximum Functions?

Posted: Thu Mar 16, 2017 8:59 pm
by Knight Captain

Re: Maximum Functions?

Posted: Fri Mar 17, 2017 1:53 pm
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.

Re: Maximum Functions?

Posted: Fri Mar 17, 2017 3:05 pm
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.

Re: Maximum Functions?

Posted: Fri Mar 17, 2017 4:59 pm
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.

Re: Maximum Functions?

Posted: Fri Mar 17, 2017 5:26 pm
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.

Re: Maximum Functions?

Posted: Fri Mar 17, 2017 6:09 pm
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.

Re: Maximum Functions?

Posted: Fri Mar 17, 2017 6:32 pm
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!