NPC Flags - Can teleport

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

NPC Flags - Can teleport

Post by Donfrow »

Been awhile since I've posted but as of late I've been back into doing some building of Glimmerscape2. I've been creating some new NPC shapes but have noticed some strange behaviour with the Exult Studio that I'm not sure if it is intended or not.

The situation is on some of the new NPC shapes I created, such as shape 1559, the "NPC flags" checkbox is always checked. The object class is "Monster". This creates the "NPC Flags" tab and the "Can teleport" box is checked in this tab. I've unchecked "Can teleport" and did multiple saves of shape info, save map, save all, but if I close Exult Studio and open the shape again the "Can teleport" is checked again. If I remove "NPC flags" on the main object tab and repeat the same process as above it rechecks "NPC Flags" on the object and "Can teleport" is checked again. If I check another "NPC Flags" box, such as "Cold immune" it saves as expected. If I check a new flag and uncheck "Can teleport" the new flag check box saves as expected but "Can teleport" remains checked no matter what I do.

I've found this "Can teleport" occurs when the "Monster" extra flag is checked. If I uncheck this NPC flags work as I would expect. If I want the "Monster" extra flag enabled and change the class from "Monster" to "Human" the issue does not occur.

Is it intentional that classes of "Monster" with extra flag "Monster" should always be able to teleport as a flag, or am I doing something strange that could be contributing to this behaviour? I am using an older version of Exult studio (1.5) as newer versions had various quarks that made map editing more difficult for me so it could also be something I'm doing with version I'm using as well. I can try updating to see if this occurs in newer versions if this is not intentional.
Donfrow
Posts: 308
Joined: Thu May 14, 2020 1:34 pm

Re: NPC Flags - Can teleport

Post by Donfrow »

I decided to give it a try with the 1.7 update since I was 2 major releases behind to see if the issue remained and it did not, so I am going to assume it was a bug in an earlier version that has been fixed as the issue no longer remains.
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: NPC Flags - Can teleport

Post by Dominus »

Pretty sure it's a bug, since most monsters can't teleport. When you
start the game, does the monster actually teleport (like mages, I think)?
from Dr. Code in the issue tracker https://github.com/exult/exult/issues/122
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: NPC Flags - Can teleport

Post by Dominus »

more from that issues tracker
Whew! I finally got exult to compile, but I had to upgrade Ubuntu. I
tried changing the "Can teleport" flag on an existing shape, and it
seems to work okay. But I can't recall how to create a new shape.

I have a feeling the problem has to do with this bit of code I found
that gets executed when reading in files:

Code: Select all

         // We already have monster data by this point.
         Monster_info *minf = info.monstinf;
         if (minf) {
             // Deprecating old Monster_info based flags for these powers:
             if (minf->can_teleport())
                 info.actor_flags |= Shape_info::teleports;
So I wonder if the user created the shape with an older version, and
he's stuck with the old monster-info flags. If I can figure out how to
create a new monster, I'll see if that might be the case.
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: NPC Flags - Can teleport

Post by Dominus »

And can you try how things work after pressing "fix old shape info" in the tools menu of ES?
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Donfrow
Posts: 308
Joined: Thu May 14, 2020 1:34 pm

Re: NPC Flags - Can teleport

Post by Donfrow »

Alas, no luck. NPC Flag "Can teleport" remains checked after fixing old shape info and unchecking the NPC flag for the teleport.
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: NPC Flags - Can teleport

Post by Dominus »

Sorry, I wrongly stated that this is fixed. It’s not ;)
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: NPC Flags - Can teleport

Post by Dominus »

Meanwhile it has been fixed and we could really use your help in determining whether it works for you now :)

Basically, you just have to run the latest commit of Studio against your mod/patch (GlimmerScape2?), and catch the Shape IDs in the warnings of the migration process (studio_out.txt and studio_err.txt), and choose SHAPES.VGA, click on any Shape of the right panel - this triggers the reading of all attributes, with flag migration and warnings. At that point the migration is done but not saved, it is saved with the Save All button or at Studio Exit by the Modified Files dialog. Dragon Baroque has used GlimmerScape - mind, not 2 - as it is on SourceForge Exult mods repository, to check all this as it contains a Shape «Wisp», ID 1298, with the Teleport flag stored in monster.dat.

Then you can run the Shape Editor on the migrated Shapes, one at a time and set the NPC Flags to whatever suitable.
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Donfrow
Posts: 308
Joined: Thu May 14, 2020 1:34 pm

Re: NPC Flags - Can teleport

Post by Donfrow »

I'll give this a try and see if I can fix/recreate it using the latest versions. You are correct I'm trying this in Glimmerscape2.

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

Re: NPC Flags - Can teleport

Post by Donfrow »

Looks like it worked. After doing the below steps it worked and I can stop every new monster from being able to teleport. Thanks for your and everyone else assistance with this.

The error messages appeared in stderr rather than studio_err as well incase anyone else runs into this.
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: NPC Flags - Can teleport

Post by Dominus »

Thanks a lot for confirming this. Without your insistence we wouldn’t have been able to find and fix these bugs! Thanks a lot for thos and your patience!
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Donfrow
Posts: 308
Joined: Thu May 14, 2020 1:34 pm

Re: NPC Flags - Can teleport

Post by Donfrow »

I'm very thankful there are people who will take the time to improve and fix these things. I wish there was a bit more documentation about some of the things available in usecode/editor though (possibly I just don't know where to look either...) like what events did, etc. Still have no idea what event 4 (weapon) in usecode is actually meant to do.

Regardless I'm thankful this project is still going on, and hopefully lasts for the next X many years until I finally finish Glimmerscape2 !
SnappyBones
Posts: 12
Joined: Sun May 30, 2021 2:41 am

Re: NPC Flags - Can teleport

Post by SnappyBones »

I'm so stoked you're doing a sequel! I loved Glimmerscape and I've had a blast digging through all the info I could find trying to make my own mod. Good luck dude
Donfrow
Posts: 308
Joined: Thu May 14, 2020 1:34 pm

Re: NPC Flags - Can teleport

Post by Donfrow »

I'm happy to hear someone is interested in the sequel! Despite many of locations and coding done there is still a lot to do so is unfortunately quite a way off. I've changed my approach to making it and making a lot more notes/documentation which I think will ultimately result in a more cohesive experience compared to the original.
Locked