Aller au contenu

Photo

What needs to be a core resource?


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

#1
AmstradHero

AmstradHero
  • Members
  • 1 239 messages
So I've been doing some thinking about exactly what resources should be labelled as core resources.

From my understanding:
Core resources will play files in the packages\\core\\override folder, rather than your module's add-in folder.
These resources will be processed by the game even when the add-in module is deactivated.

So based on those two facts (assumptions?), it seems that the only reason you would need to make something a core resource is if you wish it to be accessible if the user disables your add-in.

Which means the only reason I can see for it would be if you had an item that you wanted others to be able to use outside of your standalone module. 

As far as I can tell, there doesn't seem to be any reason to use core resources for add-ins to the main campaign.

But I could be wrong in this, and would be happy if anyone who knows more on the subject can comment.

#2
anakin5

anakin5
  • Members
  • 258 messages
My assumptions are not exactly the same as you :

Resources have 2 properties :
- Module : The resource belongs to this module.
- Owner module : If you deactivate this module, the resource is not loaded.

I assume you are talking about resource that have "Core Game Resources" in this 2 properties.


There is an other things. I think that the game doesn't load mod's .erf files if the add-in is deactivated.
So if you exported a local copy of a core game resource and put it into your builder to player package, I don't think it is going to be loaded, even if it is a core game resource.

Now, if you didn't create a .erf package of your mod and just put the override core game resource into your override folder, yes it will be loaded in all case. It's better to create the .erf I think.

This way, you can see that you can create an override of a core game resource that is deactivated when you deactivate your mod.


Now, if you want a resource to be usable in "Single player" and in any other standalone mod, you need to forget all references to "Single Player".
You module need to be an extend of "Core Game resources" only. The "Module" property of your resource must not be "Single Player". And you cannot include header files in your scripts that belongs to "Single Player".

Modifié par anakin5, 03 janvier 2010 - 10:01 .


#3
AmstradHero

AmstradHero
  • Members
  • 1 239 messages
Interesting. Glad to have your experience and comments.

So if you set a resource's Module as "Core Resources" but leave the "owner module" as your module, it will be available for any module, but still belongs to your module. Thus the resources will be unavailable if your module is unloaded.  That said, I can't imagine many cases where you'd still want your content available if your module is unloaded.

Also, I was of the understanding that if you wanted to create something to extend the single player campaign, you had to extend the single player campaign (makes sense to me) - as per this tutorial:
http://social.biowar...mpaign_Tutorial

This would suggest that you only want to use Core Resources if you want your module to be accessible to not only the single player campaign, but all other standalone modules.

Which leads me to the following conclusions:

1. If you're creating an add-in for the single player campaign:
A) You need to set your module extend the single player campaign
B) All your resources can be set with your module as the "module" and "owner module".

i.e. for Single Player campaign add-ins, there does not seem to be a need to have any resources set as core resources.


2. If you're creating a standalone module.
A) Your module does not extend any module
B) Your resources can be set with your module as the "module" and "owner module", EXCEPT if you want those resources to be available to other modules, in which case the "module" should be set as a Core Resource.

2B means that your module can be disabled and the content within will no longer be loaded by the game - though this could potentially cause problems with any saves within other modules that your content


3. If you're creating content to be available in ALL modules (single player and other user modules)
A) Your module extends Core Resources
B) Your resources are set so "Module" is Core Resources with the "owner module" is your module.

#4
Proleric

Proleric
  • Members
  • 2 361 messages
See also the discussion of core resources at the foot of this wiki page.

My take is that core resources should only be created when there is a compelling reason, e.g.

  • A generic add-in that enhances all modules
  • Items a player might take across modules (not possible yet)


#5
anakin5

anakin5
  • Members
  • 258 messages
@AmstradHero
yes, that's it.

1. B) To be clear, set the "module" properties of your files to "Single player". That will not change anything but people know they need "single player" if they use your file whitout having to look at module properties.

Modifié par anakin5, 04 janvier 2010 - 02:05 .