Aller au contenu

Photo

Overriding events - suddenly stopped working


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

#1
Emmental

Emmental
  • Members
  • 37 messages
I have a simple script to override EVENT_TYPE_ATTACKED and EVENT_TYPE_PERCEPTION_APPEAR. In this I had debugging messages so that I could see it working (which it was).

Now, in the middle of making changes to the scripts, the events inexplicably stopped firing as though they were no longer being overridden. During this time I had made no changes at all to the GDA file but now cannot, for the life of me, get this working again.

Unfortunately I've made so many changes to things trying to get it working again since then that I can't remember how things were originally. Here's what I now have:

The script (AddIns/bring_a_friend/module/override/toolsetexport/et_baf_rules_core.ncs)
(Most of the code is now taken out of this and just debugging messages are left)

#include "events_h"

void main()
{

    event ev = GetCurrentEvent();
    int nEventType = GetEventType(ev);

    switch(nEventType)
    {
        case EVENT_TYPE_ATTACKED:
        {
            object oAttacker = GetEventObject(ev, 0);
            DisplayFloatyMessage(oAttacker, "EVENT_TYPE_ATTACKED");
            HandleEvent(ev);
            break;
        }

        case EVENT_TYPE_PERCEPTION_APPEAR:
        {
            object oAppear = GetEventObject(ev,0);
            DisplayFloatyMessage(oAppear, "EVENT_TYPE_PERCEPTION_APPEAR");
            HandleEvent(ev);
            break;
        }
    }
}      

The GDA (AddIns/bring_a_friend/module/override/engineevents_et_baf.gda)
(Created with GDApp as I don't have Excel and Open Office produces no files)

ID    Label    Script
int    string    string
25    EVENT_TYPE_PERCEPTION_APPEAR    et_baf_rules_core
1001    EVENT_TYPE_ATTACKED    et_baf_rules_core   


I've tried pretty much everything I can think of, including changing the GDA file name, changing the IDs, creating a new mod, deleting everything and starting from scratch, etc. The most frustrating thing is that this was working but now won't work no matter what I do.

The only 2 possibilities I can come up with is that my GDA file is wrong or the game is ignoring any resources the toolset creates.

I've had so many strange and inconsistent problems with the toolset that I'm begining to think my installation is corrupted in some way.

Modifié par Emmental, 16 décembre 2009 - 07:26 .


#2
anakin5

anakin5
  • Members
  • 258 messages
In module properties, did you set "Script : (None)" ?

Image IPB

EDIT: same question for the other post

Modifié par anakin5, 16 décembre 2009 - 11:57 .


#3
Emmental

Emmental
  • Members
  • 37 messages
Yes, for both.

#4
Emmental

Emmental
  • Members
  • 37 messages
OK I've worked out what the problem was here.

The toolset creates the files in the mod's module/override folder, which is fine if you have your mod properties set to "Extended Module: Single Player".

However, if you change the properties to "Extended Module: Core Game Resources" the files must be in the mod's core/override, but the toolset still creates them in module. They can be moved here each time and it works.

So I must have changed my module settings from one to the other at some point, causing it to stop working.

My question here though is do I need to be using "Extended Module: Core Game Resources"? I was under the impression that "Extended Module: Single Player" would only affect the original campaign (i.e. the module Single Player) and not any 3rd party standalone modules, which is why Core Game Resources would be used. Am I wrong in this assumption?

Modifié par Emmental, 16 décembre 2009 - 02:11 .


#5
anakin5

anakin5
  • Members
  • 258 messages
core/override is core/override, be it in mod's or packages folder, it just a matter of loading priority.



When compiled, an edited core resource go to packages\\core\\override and it is fine.

When compiled, a module resource go to mod's \\module\\override and it is fine.



I think mod's core\\override is a folder you can use to put core resources override that doesn't come from the toolset : .GDA. It allows for example to clean the packages\\core\\override folder of all exported scripts without deleting stuff out of the toolset.



Now, if you says "ok, my mod is a core override only" and set "Extended module : Core game ressource", It is possible that the game don't even try to read module\\override folders, and just keep core\\override folders.



Finally, "Extended Module : Single Player" and "Extended module : Core game resource" are both reading core/override folders.

If you only override a core script, you can choose "Extended module : Core game resource", if you have at least one custom things in your module, you should use "Extended module : Single Player"

#6
Emmental

Emmental
  • Members
  • 37 messages
OK, that all makes sense.

So let's say I download a (hypothetical) new campaign that someone has created called "Darkspawn's Picnic" which is a separate adventure about Darkspawn on their day off. This is a standalone module and has nothing to do with the original campaign.

If I use an addon that's set to Extend Module: Single Player, it will still apply those changes when I use it with Darkspawn's Picnic?

#7
anakin5

anakin5
  • Members
  • 258 messages
Right, I see what you want to say.

It is possible that the game don't even try to read module\\\\override folders, and just keep core\\\\override folders.

What I supposed here is probably wrong. If it were true, you were not able to create a module with custom stuff that works will all standalone mods.

So to answer your question, if the mod is an extension of Single Player, it require Single Player to be load. So no, it will not apply changes when use with Darkspawn's Picnic.
I think you have to Extend Game Core resource.

So Game Core Resource should looked at what is in module's override folder as well.

Modifié par anakin5, 17 décembre 2009 - 01:23 .


#8
Emmental

Emmental
  • Members
  • 37 messages
Yep, that's exactly what I was saying and that's what I thought.

The problem I encountered was that, when I changed the mod to extend core game resources, the game then looks in core/override but the toolset still leaves them in module/override. As a result, the game doesn't see them.

So Game Core Resource should looked at what is in module's override folder as well.

You'd think so, yes, but that doesn't seem to happen

However, I'm not really worried about this because I can (again) move the files (ncs and gda) from module to core and it works fine. They can be packaged up that way in the dazip as well.

My mod is something that I will want to use in all games, not just single player so I'm going to go with the option of core resources and moving the files. As long as there's a workaround I can use that doesn't involve the end user having to mess with files, then it doesn't bother me so much.

Modifié par Emmental, 17 décembre 2009 - 02:29 .


#9
Emmental

Emmental
  • Members
  • 37 messages
(blah double post again)

Modifié par Emmental, 17 décembre 2009 - 02:28 .


#10
anakin5

anakin5
  • Members
  • 258 messages
The toolset put the file in core becore it is set like this in the file properties. You have to change file properties.

#11
Joshua Raven

Joshua Raven
  • Members
  • 182 messages
anakin5,



I've noticed that my module_core and other overrides of game core files don't work in Addins directories, but only work when I have them in the packages/core/override directory. I have module/module owner set to Core Game Resources. Any idea how to fix this, if possible at all?

#12
Emmental

Emmental
  • Members
  • 37 messages

anakin5 wrote...

The toolset put the file in core becore it is set like this in the file properties. You have to change file properties.


The toolset isn't putting the files in core/override, it's putting them in module/override. It puts them in module/override regardless of the Extended Module setting in the properties.

#13
TimelordDC

TimelordDC
  • Members
  • 923 messages
There is a bug in the current game version - it doesn't read the Module folders. So, the toolset is doing things correctly; it's just the game that needs a patch.

#14
Emmental

Emmental
  • Members
  • 37 messages

TimelordDC wrote...

There is a bug in the current game version - it doesn't read the Module folders. So, the toolset is doing things correctly; it's just the game that needs a patch.


Are you referring to the bug mentioned on this wiki page? That seems to be talking about a bug when creating modules as "Module", but mine is done as an "AddIn".

However, looking at your post here I get the impression that there are quite a few grey areas (even among the devs) on exactly what resources are read from which folders under which circumstances.

After all my messing about with files and folders I have a reasonable understanding of where the game is looking for resources as it applies to the things I have been doing, which sometimes involves moving resources to different folders. As anakin pointed out, we're probably not really supposed to be moving files around like that, but if that's the only way to certain things to work then that's what I have to do (as do others according to some replies I've read).

#15
Innodil Ath Nathosh

Innodil Ath Nathosh
  • Members
  • 28 messages

Emmental wrote...

anakin5 wrote...

The toolset put the file in core becore it is set like this in the file properties. You have to change file properties.


The toolset isn't putting the files in core/override, it's putting them in module/override. It puts them in module/override regardless of the Extended Module setting in the properties.


He doesn't mean the extended module setting, he means the properties OF EACH SINGLE resource.
In your resource pallette, richt click e.g. "my_script" and choose properties -->

module: the module the resource should "run" in: set THIS to core game resources
owner module: leave to your module