creating egg usecode

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
agentorangeguy
Posts: 565
Joined: Thu May 14, 2020 1:34 pm

creating egg usecode

Post by agentorangeguy »

I was playing around with creating egg usecode but I can't quite get the hang of it yet. How would I create usecode for an egg that when triggered, it sets a global flag as true? I was playing around with it and made an 'eggs.uc" file with the usecode stuff in it, basically just to set the flag as true. Do I have to number it in the void testEgg object#() () line?
-------------------------------------------------------------------------------------
Ultima 6 Mod for Exult site: http://www.ultima6.realmofultima.com/
Donfrow
Posts: 308
Joined: Thu May 14, 2020 1:34 pm

Re: creating egg usecode

Post by Donfrow »

If I am understanding what you are after it's pretty simple.

It's pretty much like you said. None of my eggs use object#()() though and to be honest I'm still not entirely sure the differences with that but I'm pretty novice.

An example being:

void testEgg()
{
gflags[1000] = true;
}

And then in the game using Exult Studio make an egg and set its triggering characteristics and in the Usecode tab enter testEgg as the "Function Number or Name".
marzo
Site Admin
Posts: 1925
Joined: Thu May 14, 2020 1:34 pm

Re: creating egg usecode

Post by marzo »

None of my eggs use object#()()
They should: when egg functions are called, Exult supplies the egg object itself as the 'item' parameter, which is available only for object# functions (or shape# functions, but those are for shapes only). If you need the egg for anything (e.g., to check its quality or location) it is necessary. In particular, the ES usecode browser for eggs allow only functions defined with object# or shape# (but maybe some validation of entered names would also be important in this sense).
------
Marzo Sette Torres Junior
aka Geometrodynamic Dragon
[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
Locked