Aller au contenu

Photo

Custom backgrounds: plot flags aren't being set (solved)


  • Veuillez vous connecter pour répondre
5 réponses à ce sujet

#1
LukaCrosszeria

LukaCrosszeria
  • Members
  • 1 304 messages
Hello everyone,

I followed the custom background tutorial for my module and everything works fine, except the plot flags. When I test them in a conversation, it appears they aren't being set.

Can anyone take a look at my code, see what I'm doing wrong?

This is my module script:

module_script.txt

In the module script I am running the module start script, which is this:

module_start_script.txt

This script calls my custom sys chargen to handle character generation:

sys_chargen.txt

It's in this script that the flags are supposed to be set, using the function "sgn_Chargen_SetupPlotFlags(oChar);"

The function is specified in the include here:

sys_chargen_h.txt

This include holds the constants:

2da_constants_script.txt

In my override directory I have the following gda's:
background_defaults.GDA
background_desc.GDA
background_icons.GDA
background_names.GDA
Backgrounds.GDA
chargen_preload.GDA

I checked to make sure the int ID's in the backgrounds 2da correspond to the 2da constants.

So I'm really at a loss at what I'm doing wrong. Any help would be appreciated, thanks.

Modifié par LukaCrosszeria, 25 septembre 2011 - 07:37 .


#2
jackkel dragon

jackkel dragon
  • Members
  • 2 047 messages
I doubt it's the problem, but I don't think you need two "break" ends to each case, I'm sure it's only one. (In the sys_chargen_h replacement.)

Also, I'd check to see if using literals (1 rather than BACKGROUND_RECRUIT in the case check) helps at all. It probably doesn't, but I once had a problem that magically solved itself when I changed that.

Also, in

HandleEvent(ev, RESOURCE_SNG_SCRIPT_MODULE_CORE_START);

, is that constant defined? The seemingly automatic creation of constants based on certain variables eldues me, and I can't find a definition for the start script constant. Ignore this if other parts of the start script have been working fine.

Otherwise, I need more time to look, I can't see anything that stands out...

Modifié par jackkel dragon, 21 septembre 2011 - 06:34 .


#3
LukaCrosszeria

LukaCrosszeria
  • Members
  • 1 304 messages
Thanks for taking a look at my scripts and replying. I'll try replacing the constant with a literal, who knows, could be it. I've encountered some pretty strange quirks in the toolset already :P

yeah that handle event refers to a constant I defined in a script include. It just refers to the .ncs file. I'll get back to you and see if this helped.

Modifié par LukaCrosszeria, 21 septembre 2011 - 06:58 .


#4
Sunjammer

Sunjammer
  • Members
  • 925 messages
Replacing constants with literal values will not change anything unless they were defined incorrectly or used incorrectly. This is because the compiler already does this substitution as part of the compilation process.

I'm AFT (away from toolset) right now but I'll check out your issue when I get home.

#5
Sunjammer

Sunjammer
  • Members
  • 925 messages
Your "default" case (which handles CharGen) is in your "module start" script rather than your "module core" script.

This means the real sys_chargen rather than your sng_sys_chargen script is handling the various CharGen events as they are dropping through to the real module_core script. Since you are overriding the core backgrounds it appears that your script is working up to that point when in fact it is not being called.

Move the "default" case from your "module start" script to your "module core" script and or merge your entire "module start" script into your "module core" script (as there doesn't seem to be any need to have both) and that should fix things for you.

Modifié par Sunjammer, 22 septembre 2011 - 09:17 .


#6
LukaCrosszeria

LukaCrosszeria
  • Members
  • 1 304 messages
:o That did it, thanks so much for taking a look at my scripts, Sunjammer! I never would have found that by myself. *hands out cookies*