Page 1 of 1
UI_create_barge_object intrinsic
Posted: Wed Mar 15, 2017 3:23 pm
by agentorangeguy
I've noticed the UI_create_barge_object intrinsic doesn't work. I tried to use it but it wasn't declared. I looked up the actual number in the exult source code and it said 0xd5 so it should be there and useable like the others, but I couldn't get it to work. Is there a reason it isn't working?
Re: UI_create_barge_object intrinsic
Posted: Wed Mar 15, 2017 4:12 pm
by Knight Captain
It compiled okay for me:
var avatar_position = UI_get_object_position(AVATAR);
UI_create_barge_object(8, 8, NORTH);
UI_update_last_created([avatar_position]);
I'm not able to manipulate it the same way I can with one created manually in ES. Double-clicking on the code-created one does not do anything.
Re: UI_create_barge_object intrinsic
Posted: Wed Mar 15, 2017 6:28 pm
by agentorangeguy
When I use "UI_create_barge_object" it tells me 'UI_create_barge_object' not declared. I'm using BG though. hmm..
Re: UI_create_barge_object intrinsic
Posted: Sat Mar 25, 2017 5:30 pm
by Knight Captain
Did you check using the latest UCC.exe?
And did you create a bug for this? There's an issue with changing egg shapes as well, in that they aren't treated like they are "special" but just plain old shapes with no additional modifications available in ES. So this barge issue might be connected to that.
Re: UI_create_barge_object intrinsic
Posted: Sat Mar 25, 2017 6:29 pm
by drcode
I can see why the eggs created in Usecode don't work, and am thinking about a solution. We might need to add a 'create_egg' intrinsic.
But the barges *ought* to work, so I'm looking at that too. Something's wrong...
Re: UI_create_barge_object intrinsic
Posted: Sat Mar 25, 2017 7:10 pm
by Knight Captain
I would lean towards a new egg intrinsic rather than adding to an existing intrinsic, both for troubleshooting purposes and simplicity for modders. It would be awesome to get all egg types available this way, not just Usecode eggs.
The only correlating fact I can see between these two shapes is that they work fine when added via ES, but not via Usecode.
Your help on these things is much appreciated, DrCode.
Re: UI_create_barge_object intrinsic
Posted: Sat Mar 25, 2017 7:25 pm
by drcode
Playing around:
1. I noticed that creating a barge through the shape browser wasn't doing it correctly, so I'm fixing that.
2. But double-clicking a barge itself doesn't do anything; you need to have barge 'parts' on top of it. For example, placing a piece of the cart over the new barge and double-clicking that will execute code to find the barge, and then looks for a horse as well.
3. You probably already know that the 'e' key turns on display of eggs and barges. If the barge is created correctly, you'll see a yellow outline of its size, in addition to the red square. As a test, put a horse and a cart piece inside it and double-click one of them (BG).
Re: UI_create_barge_object intrinsic
Posted: Sun Mar 26, 2017 10:51 am
by agentorangeguy
wow didn't know that, thanks for all your work on these things DrCode!
Re: UI_create_barge_object intrinsic
Posted: Tue Mar 28, 2017 8:55 pm
by drcode
How useful would it be to have a UI_create_egg intrinsic? It would have to be a bit complicated, with parameters to set all the criteria, plus different ones for each egg type. Are there things you can only do this way, vs creating an egg in ES and then, say, changing its usecode function?
Re: UI_create_barge_object intrinsic
Posted: Wed Mar 29, 2017 7:46 am
by Knight Captain
Very useful to me.
It's complicated, but more "no" than "yes".
I had requested a create-egg-via-usecode feature for a few technical reasons:
A) The mod I am doing is going to require tens of eggs. I would need to manually track and place those rather than just script them. Woe to me if I want to change them.
B) Map editing is fraught with danger, and a wrong change can require reverting and retrying. This has tripped up other modders.
C) Maps are not broken out into source code but rather use a compressed binary, so change tracking relies solely on the submitter's description. SIfixes uses an altered map, mostly due to the inn keeper key collection eggs, but there's no way to prove that via source.
D) Usecode eggs are visibly different from others, so conditional eggs for weather, monsters, etc won't stand out via map editing or show egg mode.
E) Adding many eggs from the start could have a tiny performance impact since each would need to check flags as the player walks around.
F) The only mod storyline part I have written to require egg replacement is in one of the original-but-missed caverns in the Mountains of Freedom. I may be able to change the existing eggs via usecode_array or script blocks.
Ideally we'd have multiple commands like UI_create_usecode_egg, UI_create_teleporter_egg, UI_create_spawn_egg, etc, so the syntax for each is clear. Each would have the coordinates first, then relevant inputs.
While I'd love this feature, I think as a limited resource you're more valuable fixing Combat since that impacts all players not just a few modders.
Re: UI_create_barge_object intrinsic
Posted: Wed Mar 29, 2017 12:39 pm
by agentorangeguy
I agree, combat is probably the highest priority since it's the most broken and is probably the most glaring bug in all of Exult and impacts all players. But whatever you do , it's greatly appreciated!
I've not tried the changes yet to the barge object intrinsic yet, since i've been doing map work. As far as the U6 mod goes, I need to be able to create the barge with the proper x, y values and place it where the balloon shape would be, and have it useable with the shape. I'm not sure exactly which route I'm going for the balloon yet, but one idea is to make it similar to the magic carpet where the party would stand in the "basket", doubleclick would raise start the balloon frames to inflate the balloon then double clicking again would lower it then, then being able to deflate the balloon and pack it. The easier way would be not rendering the party once the shape is doubleclicked and a few other things to make it look nice. Both require better looking shapes from Crowley than I'm using right now for a stand in lol
Re: UI_create_barge_object intrinsic
Posted: Fri Mar 31, 2017 6:51 pm
by Knight Captain
How did the expansions add eggs in addition to the map changes? Might there a clue there?
Re: UI_create_barge_object intrinsic
Posted: Sat Apr 01, 2017 8:51 pm
by Dominus
Didn't they just make map changes?
Re: UI_create_barge_object intrinsic
Posted: Sat Apr 01, 2017 9:54 pm
by Knight Captain
If I recall right, it was possible to install the expansions and keep going with existing saved games. So how would they update those saves?
Re: UI_create_barge_object intrinsic
Posted: Sat Apr 01, 2017 10:13 pm
by drcode
Looking through the usecode disassembly for the copy of SI+SS that I have, the only time I see an egg shape # (0113H) used is in calls to 'find_nearby'.
Re: UI_create_barge_object intrinsic
Posted: Sat Apr 01, 2017 11:31 pm
by Knight Captain
That's a valid point. I have a mostly pulled-apart version of SI+SS Usecode I can share with you.
For the UCC issue I have, I'll need to check with the latest build of Exult Tools.
Re: UI_create_barge_object intrinsic
Posted: Mon Apr 03, 2017 11:19 am
by agentorangeguy
I was thinking of some new exult intrinsics / features that could be useful. Would it be possible to make something to where you could place combos from combos.flx in Exult studio via usecode? Maybe the parameters could be something like x, y, z location to place, then # of combo in the combos.flx file. It would be fun to make randomized camps of enemies / monsters in the wilderness like that in an easy way rather than having to manually set the x, y offsets and placing individual objects, but using something like UI_place_combo that will check for space to place the combo and place the combo if true.
Other possible uses for this would be modifying the bedroll code where the Avatar makes a camp that you create in ES with the combo, and places it near the bedroll (Maybe a campfire, pot with food, etc.).
Would also be useful in creating barges maybe... instead of manually creating the barge line by line in code, you create the combo first in ES then you could place the entire combo via exult intrinsic in the code?
Would this be possible?
Re: UI_create_barge_object intrinsic
Posted: Mon Apr 03, 2017 7:30 pm
by drcode
Could be possible. Interesting idea.
Re: UI_create_barge_object intrinsic
Posted: Mon Apr 03, 2017 9:23 pm
by Knight Captain
One of the things I've written as new Usecode function is to create the SI game start boat piece by piece (at once to the player). I did hard code the placement, but it would be possible to make it either an egg and set the placements + or - based on that, or send the position coordinates and then set the placements + or - based on that. Doing something similar for the balloon or barge would be possible.
I like the idea of randomized camps!
Re: UI_create_barge_object intrinsic
Posted: Tue Apr 04, 2017 11:07 am
by Knight Captain
I just got wiped out by a Z level height limit:
https://sourceforge.net/p/exult/bugs/1532/
The manor for Selina that I had planned is unusable due to this bug.
Re: UI_create_barge_object intrinsic
Posted: Tue Apr 04, 2017 5:39 pm
by Knight Captain
This is all via Usecode:
This is the result of the limit on the Z-axis:
The highest Z-axis point I've found in SI is the tower NW of Moonshade, with fence pieces at the top at Z-14.
Re: UI_create_barge_object intrinsic
Posted: Tue Apr 04, 2017 5:50 pm
by Dominus
That's odd. I think I built higher than that with Studio and it kept.
Re: UI_create_barge_object intrinsic
Posted: Tue Apr 04, 2017 5:58 pm
by Knight Captain
Highest surviving levels:
Re: UI_create_barge_object intrinsic
Posted: Wed Apr 05, 2017 8:20 pm
by agentorangeguy
Why did you build it via code, instead of manually? Looks pretty cool though!
Re: UI_create_barge_object intrinsic
Posted: Thu Apr 06, 2017 2:04 am
by Knight Captain
To show that time had passed while the Avatar was unconscious after Batlin's death.
Re: UI_create_barge_object intrinsic
Posted: Thu Apr 06, 2017 4:28 am
by Dominus
Can you confirm that it is happening with both manual and usecode building?
Re: UI_create_barge_object intrinsic
Posted: Thu Apr 06, 2017 5:14 am
by Knight Captain
Both, via Edit Mode and via Usecode.
0x10 -> 0x0
0x11 -> 0x1
etc.
I'm also not able to save manually placed z-0 flat shapes at z-0 if there's already grass there.
Re: UI_create_barge_object intrinsic
Posted: Thu Apr 06, 2017 12:48 pm
by Dominus
Can you give me an easy to trigger example code? Best a mod with a savegame to trigger it. It may be a regression and I might be able to quickly test with my collection of snapshots where it broke (if it broke in the last couple of years). I'm not able to test with Exult Studio as I didn't keep OS X snapshots of that.
Re: UI_create_barge_object intrinsic
Posted: Thu Apr 06, 2017 3:22 pm
by Knight Captain
Sure, I'll email you my latest mod code.
I'm also seeing that importing PNG files into ES is not working correctly, but haven't tracked that down yet. Might be my image editor?
Re: UI_create_barge_object intrinsic
Posted: Thu Apr 06, 2017 3:38 pm
by Dominus
No idea. I generally avoid that and save to shp and import from sho.
Side note, I'd rather see you start new topics than going off topic again and again (this thread is a prime example
)
Re: UI_create_barge_object intrinsic
Posted: Thu Apr 06, 2017 3:43 pm
by Knight Captain
Yeah, it was GIMP. Anyway, the file is over to you.