News:

Be sure to check out the updated artwork by Vix, located in the "Art Reviews and Previews" board!

Main Menu

I've lost my compass

Started by Andy123, August 04, 2023, 11:41:26 PM

Previous topic - Next topic

Andy123

I've lost my compass in many ways, but as it concerns us, I'll only be referring to the one in my DC game

We had an issue where the compass was displaying on overland maps which looked weird. Until a work around was arrived at I some how removed my compass. I thought I'd just removed the image file from the folder, but given that putting it back didn't fix it, I'd say I've done something else as well.

There's been an engine update or two since then, certainly a few tweaks to data bases, the tutorial design doesn't have a compass, so I figured a minimod would demonstrate this nicely. Except the minimod I put together recently had a compass.

It looks a lot like this is something I've broken but I'm not sure where to begin trouble shooting it. Is there a short list of things that need to be in place in order for the compass to display? 

manikus

It sounds like you either removed/disabled the SA or disabled/Removed the Hook in the SA. If it had been because you removed the image only, you would have been getting a graphics error ever time you did anything in 3d mode.

The quickest way to find the SA is to export your SA database, open it in your favorite text editor and 'find' compass. Then compare it to the one in the default SA database (or if missing add it back in).

Andy123

The only thing I can find that deals with the compass is the special graphics SA.

The only difference that I could spot between the old SA in the TemplateDesign folder (which works) and the updated one in my design (no compass) was direction faced being written out more efficiently and an allowance for different screen widths:

Old:
\(BEGIN)
name = SpecialGraphics
[ABCD$CompassDisplay] =
-$IF ($GET_EVENT_Attribute(0,"NoCompass") != "-?-?-") {$RETURN;};
-$IF ($GET_PARTY_FACING() ==# 0)
- {
- $SET_HOOK_PARAM( 3, "border_Compass.png" );
- $SET_HOOK_PARAM( 4, 272 );
- $SET_HOOK_PARAM( 5, 263 );
- $SET_HOOK_PARAM( 6, 0 );
- $SET_HOOK_PARAM( 7, 0 );
- $SET_HOOK_PARAM( 8, 78 );
- $SET_HOOK_PARAM( 9, 46 );
- };
-$IF ($GET_PARTY_FACING() ==# 1)
- {
- $SET_HOOK_PARAM( 3, "border_Compass.png" );
- $SET_HOOK_PARAM( 4, 272 );
- $SET_HOOK_PARAM( 5, 263 );
- $SET_HOOK_PARAM( 6, 78 );
- $SET_HOOK_PARAM( 7, 0 );
- $SET_HOOK_PARAM( 8, 78 );
- $SET_HOOK_PARAM( 9, 46 );
- };
-$IF ($GET_PARTY_FACING() ==# 2)
- {
- $SET_HOOK_PARAM( 3, "border_Compass.png" );
- $SET_HOOK_PARAM( 4, 272 );
- $SET_HOOK_PARAM( 5, 263 );
- $SET_HOOK_PARAM( 6, 156 );
- $SET_HOOK_PARAM( 7, 0 );
- $SET_HOOK_PARAM( 8, 78 );
- $SET_HOOK_PARAM( 9, 46 );
- };
-$IF ($GET_PARTY_FACING() ==# 3)
- {
- $SET_HOOK_PARAM( 3, "border_Compass.png" );
- $SET_HOOK_PARAM( 4, 272 );
- $SET_HOOK_PARAM( 5, 263 );
- $SET_HOOK_PARAM( 6, 234 );
- $SET_HOOK_PARAM( 7, 0 );
- $SET_HOOK_PARAM( 8, 78 );
- $SET_HOOK_PARAM( 9, 46 );
- };
\(END)

Update:
\(BEGIN)
name = SpecialGraphics
[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijkl$CompassDisplay] = $VAR sWidth; $VAR face;
-$IF ($GET_EVENT_Attribute(0,"NoCompass") != "-?-?-") {$RETURN;};
-sWidth = $GET_CONFIG("Screen_Width");
-face = $GET_PARTY_FACING();
-$IF (sWidth ==# 640)
- {
- $SET_HOOK_PARAM( 3, "border_Compass.png" );
- $SET_HOOK_PARAM( 4, 272 );
- $SET_HOOK_PARAM( 5, 263 );
- $SET_HOOK_PARAM( 6, 78 *# face );
- $SET_HOOK_PARAM( 7, 0 );
- $SET_HOOK_PARAM( 8, 78 );
- $SET_HOOK_PARAM( 9, 46 );
- };
-$IF (sWidth ==# 1024)
- {
- $SET_HOOK_PARAM( 3, "border_Compass.png" );
- $SET_HOOK_PARAM( 4, 512 );
- $SET_HOOK_PARAM( 5, 520 );
- $SET_HOOK_PARAM( 6, 78 *# face );
- $SET_HOOK_PARAM( 7, 0 );
- $SET_HOOK_PARAM( 8, 78 );
- $SET_HOOK_PARAM( 9, 46 );
- };
\(END)

manikus

Both versions of the script work for me (using the most recent engine).

Andy123

I've run with the old version because it works, and included the line
$IF ($GET_GAME_CURRLEVEL() == 2) {$RETURN;};...to get rid of it on my overland map.

Is there a way to make it not show on bigpics?

manikus

Have you tried setting the event attribute to "NoCompass"? This will work for any Event type that shows the compass (as defined in the particular Special Ability).

Andy123

No I haven't. That sounds simple enough, are you able to link me to a help doc that explains event attributes and how to use them?

manikus

Quote from: Andy123 on August 29, 2023, 06:33:29 AMNo I haven't. That sounds simple enough, are you able to link me to a help doc that explains event attributes and how to use them?
Nope. It never got written. However, if you search the forums, I did release an example mod. Looking at the design will tell you all you need to know, if the thread doesn't. ;) You pretty much select the particular Event in the Event Editor and click on the Event Attribute button. In the popup, type "NoCompass" (without the quotation marks).

Andy123

Quote from: manikus on August 29, 2023, 10:02:37 AMNope. It never got written. However, if you search the forums, I did release an example mod. Looking at the design will tell you all you need to know, if the thread doesn't. ;) You pretty much select the particular Event in the Event Editor and click on the Event Attribute button. In the popup, type "NoCompass" (without the quotation marks).

Thanks, that worked. For anyone just as clueless as me quietly following along, I put NoCompass in both fields of the pop up.

The post you were talking about is here:
https://forums.goldbox.games/index.php?topic=3348.0