Aller au contenu

Photo

compiling script did not create an .NCS file


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

#1
Rolenka

Rolenka
  • Members
  • 2 257 messages
I'm trying to modify effect_damage_h. There are no .ncs files in the toolsetexport folder. Did I do something wrong?

Modifié par Rolenka, 14 décembre 2009 - 07:17 .


#2
stzehn

stzehn
  • Members
  • 26 messages
all _h files are includes they are called by other scripts and are not compiled on their own. If you look at some scripts (for example module_core.nss) you will finde that it icludes several _h scipts. If module_core is compiled the compiler will get the code of those _h scripts and include their code. So if you want to change a _h script you have to find all other scripts that inculde them, and recompile them. Otherwise your changed code won't make it into your mod.

Modifié par stzehn, 14 décembre 2009 - 08:01 .


#3
Rolenka

Rolenka
  • Members
  • 2 257 messages
Thanks. That's... awful. I don't suppose there's anything that might help with which scripts include which.

#4
Craig Graff

Craig Graff
  • Members
  • 608 messages
Many of the core files are included quite widely. To find a list of the files which directly reference a header scriptyou can right-click on the script and choose Properties, then click on the Referenced By tab. This isn't terribly useful in the case of effect_combat_h, since it is included by include files.



The best way to find the full list of affected resources might be to export the header file with dependent resources, then filter plot files and header files out of the list (starting with an empty packages/core/override folder helps with this).

#5
Rolenka

Rolenka
  • Members
  • 2 257 messages
But even if I did all of that, since a relatively simple mod would have to include so many files, it wouldn't be very compatible with other mods or future updates to the game, correct?

#6
stzehn

stzehn
  • Members
  • 26 messages

Rolenka wrote...

But even if I did all of that, since a relatively simple mod would have to include so many files, it wouldn't be very compatible with other mods or future updates to the game, correct?


I would not say that, you just have to check what those other scripts do and if they hav any possible influence, sideeffect or collision with what you want to change. If there is no problem you can just ignore that script, otherwise you have to recompile them as well. I would think after checking that there should'nt be that much scripts left.

#7
Rolenka

Rolenka
  • Members
  • 2 257 messages
Okay, so I did like Craig said and exported all dependent resources, filtering out all header and plot files. Here's what's left:

effect_addability.nss
effect_polymorph.nss
gen00pt_backgrounds.ncs
gen00pt_backgrounds.nss
gen00pt_class_race_gend.ncs
gen00pt_class_race_gend.nss
gen00pt_party.ncs
gen00pt_party.nss
genpt_approval_follower.ncs
genpt_approval_follower.nss
sys_chargen_engine.nss
sys_disease.nss
sys_injury.nss

But none of them include effect_damage_h. As Craig said, only other header files include it. But stzehn said I need to find the non-header file that includes it, since it rolls into there for compiling. But there isn't one.

So am I hosed? effect_damage_h is unmoddable?

Thanks for your help everyone. I'm learning...

#8
stzehn

stzehn
  • Members
  • 26 messages

Rolenka wrote...
So am I hosed? effect_damage_h is unmoddable?


I would not say that ;)

The Problem can be solved.

What precisely do you want to change in your include file ?
Then we have to find out if any script that includes effect_damage_h as well or another incluude file wich by itself includes effect_damage_h can be a problem or not.

Precisely does it matter for your mod to funktion if that file is kept unchanged or not, and to find that script that uses your changed include (either direct or through another iclude) and produces your desired effect.

Modifié par stzehn, 15 décembre 2009 - 08:25 .


#9
Rolenka

Rolenka
  • Members
  • 2 257 messages
What I'm trying to do is remove friendly fire from all difficulties. I don't even want to use the mod, it's just been a popular request and I thought it'd be an easy thing to get me started modding.

Let me see if I'm following.

What I've been doing is working with local copies of everything. But I'm thinking when I compile one of these NCS-able files, which will hopefully roll in effect_damage_h, it's going to pull it from the library, not from a local copy I have open. Which means I'm going to have to actually check out effect_damage_h and modify it. Could this break my game if I make a mistake? Can it be reverted later?

Anyway, I guess I'm going to have compile all of those aforementioned files with an NCS associated with it, since there's no way of knowing which contains the compiled code of effect_damage_h. Am I then going to have include all of them in my mod? Or I suppose I could trial-and-error to see which one is really needed.

Thanks again. I know I'm probably being frustrating. NWN2 script editing was so much easier.

#10
Magic

Magic
  • Members
  • 187 messages

Rolenka wrote...

Okay, so I did like Craig said and exported all dependent resources, filtering out all header and plot files. Here's what's left:

effect_addability.nss
effect_polymorph.nss
gen00pt_backgrounds.ncs
gen00pt_backgrounds.nss
gen00pt_class_race_gend.ncs
gen00pt_class_race_gend.nss
gen00pt_party.ncs
gen00pt_party.nss
genpt_approval_follower.ncs
genpt_approval_follower.nss
sys_chargen_engine.nss
sys_disease.nss
sys_injury.nss

But none of them include effect_damage_h. As Craig said, only other header files include it. But stzehn said I need to find the non-header file that includes it, since it rolls into there for compiling. But there isn't one.

So am I hosed? effect_damage_h is unmoddable?

Thanks for your help everyone. I'm learning...

No, basically you already found what you need. These scripts you listed use functions from effect_damage_h. They don't do this directly, as you say, since they don't include effect_damage_h directly. However, they include header files which use functions from effect_damage_h themselves. The dependencies state that. So what's left is to recompile all these files, then your customization is used.

Checking out and saving is no problem. Checking in overwrites. I wouldn't do that for now.

Edit: Oh, even checking in should be no problem basically, since you can restore former versions.

You could try to find out which of these files actually use the functions you modify but that could be quite tiresome. Don't know, maybe still worth it.

Modifié par Magic, 15 décembre 2009 - 10:25 .


#11
Craig Graff

Craig Graff
  • Members
  • 608 messages
Restoring is pretty simple.
  • Right click on a palette item and select Resource History from the context menu (if no history is showing up, select another palette then reselect the one you wish to restore).
  • Find the version of the file that you wish to restore and right-click the corresponding line on the Resource History list.
  • Select Restore Resource from the context menu.
  • Check in the file.


#12
Magic

Magic
  • Members
  • 187 messages
By the way, local copies also work for compiling. You don't need to check out but it's really no problem. Makes things easier if you want to makes more changes some other time.

#13
Rolenka

Rolenka
  • Members
  • 2 257 messages
Okay, I made my changes to effect_damage_h, and compiled all of the dependent scripts with no errors.

I cut/paste all the resulting files into C:\\Documents and Settings\\My Name\\My Documents\\BioWare\\Dragon Age\\packages\\core\\override\\Mod Name (I wasn't sure if toolsetexport would count)

Fired up the game and nothing had changed.

So either I did something wrong in the process or something wrong in the coding. All I really did was comment out the difficulty level check, it's opening brace and it's closing brace. There's probably a more elegant way, but it was quick & dirty.

        // ---------------------------------------------------------------------
        // DIFFICULTY: No friendly fire in easy difficulty
        // ---------------------------------------------------------------------
//        if (GetGameDifficulty() == GAME_DIFFICULTY_CASUAL)
//        {
            int bUnresistable = (nDamageFlags &  DAMAGE_EFFECT_FLAG_UNRESISTABLE) == DAMAGE_EFFECT_FLAG_UNRESISTABLE;
            int bDot = (nDamageFlags &  DAMAGE_EFFECT_FLAG_FROM_DOT) == DAMAGE_EFFECT_FLAG_FROM_DOT;

            // Unresistable damage still gets through, unless it's from a dot
            if (!bUnresistable || bDot)
            {
                if (IsFriendlyFireParty(oTarget,oDamager))
                {
                    #ifdef DEBUG
                      Log_Trace(LOG_CHANNEL_COMBAT_DAMAGE,"effect_damage_h.IsDamageAllowed",
                        "Easy Difficulty, Not allowing damage between members of the player's party");
                    #endif

                    return FALSE;
                }
            }

//        }



#14
Rolenka

Rolenka
  • Members
  • 2 257 messages
Also, I noticed that:

gen00pt_backgrounds.ncs
gen00pt_backgrounds.nss
gen00pt_class_race_gend.ncs
gen00pt_class_race_gend.nss
gen00pt_party.ncs
gen00pt_party.nss
genpt_approval_follower.ncs
genpt_approval_follower.nss

Are all plot files (craig had suggested earlier I filter those out). So there are no non-plot, non-header scripts associated with effect_damage_h that are compiled directly.

Modifié par Rolenka, 16 décembre 2009 - 03:18 .


#15
Craig Graff

Craig Graff
  • Members
  • 608 messages

Rolenka wrote...

Also, I noticed that:

gen00pt_backgrounds.ncs
gen00pt_backgrounds.nss
gen00pt_class_race_gend.ncs
gen00pt_class_race_gend.nss
gen00pt_party.ncs
gen00pt_party.nss
genpt_approval_follower.ncs
genpt_approval_follower.nss

Are all plot files (craig had suggested earlier I filter those out). So there are no non-plot, non-header scripts associated with effect_damage_h that are compiled directly.


These are not plot files, but rather plot script files - rather a different thing.

The problem you are having with the core scripts is that there seems to be a bug where core files are not currently overwritten by files in the addin core override, but only in packages/core/override.

Hopefully this will be fixed in an upcoming patch.

#16
Rolenka

Rolenka
  • Members
  • 2 257 messages
There doesn't seem to be a My Documents/Bioware/Dragon Age/addin/core/override folder. There is a My Documents/Bioware/Dragon Age/packages/core/override folder, and there is a Dragon Age/packages/core/override folder (the game folder itself).

I tried both, actually. Am I not understanding you correctly?

#17
Craig Graff

Craig Graff
  • Members
  • 608 messages
As I said above, packages/core/override (the one in your documents folder should work fine).

#18
Rolenka

Rolenka
  • Members
  • 2 257 messages
Ah, I read "addin core override" as "addins/core/override." Thanks again.

Modifié par Rolenka, 16 décembre 2009 - 06:35 .


#19
Rolenka

Rolenka
  • Members
  • 2 257 messages
I guess I have to assume, then, that none of these files compile the IsDamageAllowed() function, which is where my altered code lives.

Modifié par Rolenka, 16 décembre 2009 - 09:38 .


#20
Magic

Magic
  • Members
  • 187 messages
Rolenka, I think the dependency between your modification and the damage functions is lost because damage is applied through events. Pretty sure there won't be script dependencies only based send/receive events.



Please recompile player_core.nss and apply a dot spell. I'm searching for direct damage in the meantime.

#21
Magic

Magic
  • Members
  • 187 messages
For your information, this is one of the script chains for dots:

spell_blizzard.nss - main() - call of ApplyEffectDamageOverTime()
effect_dot2_h.nss - ApplyEffectDamageOverTime() - call of ApplyEffectOnObject(EFFECT_TYPE_DOT)
core_h.nss - ApplyEffectOnObject() - call of Engine_ApplyEffectOnObject()
-- Engine_ApplyEffectOnObject() is an engine function
-- target receives an event of EVENT_TYPE_APPLY_EFFECT

rules_core.nss - main() - call of Effects_HandleApplyEffect()
effects_h.nss - Effects_HandleApplyEffect() - call of Effects_HandleApplyEffectDOT()
effect_dot2_h.nss - Effects_HandleApplyEffectDOT() - call of DelayEvent(EVENT_TYPE_DOT_TICK)
-- DelayEvent() is an engine function
-- target receives an event of EVENT_TYPE_DOT_TICK

player_core.nss - main() - call of Effects_HandleCreatureDotTickEvent()
effect_dot2_h.nss - Effects_HandleCreatureDotTickEvent() - call of Effects_HandleDotEffectTick()
effect_dot2_h.nss - Effects_HandleDotEffectTick() - call of Effects_ApplyInstantEffectDamage()
effect_damage_h.nss - Effects_ApplyInstantEffectDamage() - call of IsDamageAllowed()

#22
Magic

Magic
  • Members
  • 187 messages
Well, instants go through combat_h.nss but end up in player_core.nss as well. If you only changed IsDamageAllowed(), player_core.nss is probably the only thing to recompile.

Interestingly, spell combos go through module_core.nss into sys_comboeffects.nss.

Edit: Nope, wrong assumptions about the instants on my side. They go into rules_core.nss.

I tried it myself now because it's done pretty quickly:
1. Open local copy of effect_damage_h.nss, comment out the casual difficulty check, save.
2. Open local copy of player_core.nss, compile.
3. Open local copy of rules_core.nss, compile.

Modifié par Magic, 16 décembre 2009 - 10:35 .


#23
Rolenka

Rolenka
  • Members
  • 2 257 messages
It works, you're amazing! How did you know where to look?

I had begun trying to find an end-run around effect_damage_h, like adding an allegiance check in the AOE scripts themselves (like spell_cone, since Morrigan has COC in my game).

Strangely using IsObjectHostile worked, but IsPartyFriendlyFire did not. I have to wonder if I didn't declare oDamager correctly (I just put "object oDamager" up with the other variables at the start of void _ApplySpellEffects)

The problem with IsObjectHostile is monsters wouldn't be able to nuke their allies.

I was thinking checking to see if IsPartyFriendlyFire returned false before the damage is applied would be more compatible with future updates to the game or other mods, since it wouldn't modify core scripts.

Yes, I haven't coded an actual program from scratch since high school. I know just enough to get myself into trouble :( but this has brought a lot of it back.

Modifié par Rolenka, 16 décembre 2009 - 11:18 .


#24
Magic

Magic
  • Members
  • 187 messages
Well, after you wrote what you modified where, and especially what all you did without your modifications being called, I knew where to look. Effects led to events and so on. It was still quite a search because the script volume is soo huge!

I didn't understand the object thing. It's too late for me now. -_-
For now, I simply wish you success instead. :)

Modifié par Magic, 16 décembre 2009 - 11:42 .


#25
Rolenka

Rolenka
  • Members
  • 2 257 messages
You're still a lifesaver!