1. Dismiss Notice
  2. GOG.com logo

    Thanks to YOUR votes, GOG.com now sells:
    - Sea Dogs - Sea Dogs: Caribbean Tales
    - Sea Dogs: City of Abandoned Ships

    Vote now to add Pirates of the Caribbean to the list!

    Dismiss Notice
  3. Under the Crossbones Podcast

    A Pirate Podcast with Interviews
    Music, Comedy and all things Pirate!

    - Episode Guide - About - Subscribe -
    - Twitter - Facebook - iTunes - Android -
    - Youtube - Fill the Coffers -

    Dismiss Notice
  4. New Horizons logo

    Quick links for PotC: New Horizons
    - Download latest version
    - Wiki - FAQ - Report bugs here
    - ModDB profile

  5. GOF logo

    Quick links for AoP2: Gentlemen of Fortune 2
    - Downloads and info
    - Historical Immersion Supermod
    - ModDB Profile

Dismiss Notice
New to the forum?
Please take a moment to read our Welcome Message and Forum Rules.

Need Help Dynamic lighting for location models

Discussion in 'Sea Dogs: City of Abandoned Ships' started by Myth, Sep 8, 2017.

  1. Myth

    Myth Master Mariner

    Joined:
    Mar 25, 2014
    Messages:
    203
    Gender:
    Male
    Good afternoon. Do we have people on the forum who understand the dynamic coverage of the location of the game? I'm talking about the light that is installed through scripts. Thank you.
     
  2. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,615
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
  3. Myth

    Myth Master Mariner

    Joined:
    Mar 25, 2014
    Messages:
    203
    Gender:
    Male
    no

    Locations[n].models.always.l0.tech = "LocationModelBlend";
    Locations[n].models.always.l1 = "plan_1";
    Locations[n].models.always.l1.level = 8;
    Locations[n].models.always.l1.tech = "LocationModelBlend";
    Locations[n].models.always.l2 = "plan_2";
    Locations[n].models.always.l2.level = 7;
    Locations[n].models.always.l2.tech = "LocationModelBlend";
    Locations[n].models.always.l3 = "plan_3";
    Locations[n].models.always.l3.level = 6;

    like shis
     
  4. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,615
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    That does not sound familiar to me, sorry. :(
     
  5. Myth

    Myth Master Mariner

    Joined:
    Mar 25, 2014
    Messages:
    203
    Gender:
    Male
    I will clarify my question: I'm wondering whether it's possible to add light to the location as a program, without editing the resources?
     
  6. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,615
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    I know PotC:NH has a system that allows you to add new locators through code.
    That way you don't need to edit the location GM files.
     
  7. Myth

    Myth Master Mariner

    Joined:
    Mar 25, 2014
    Messages:
    203
    Gender:
    Male
    And?
     
  8. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,615
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    You have to look through the files. Probably "MAXIMUS_functions.c", search for "WriteAdditionalLocators" or something like that.
     
  9. Jan Marten

    Jan Marten de ZeeRoovers Group Storm Modder

    Joined:
    Sep 27, 2008
    Messages:
    440
    Gender:
    Male
    The Dynamic lighting ... included, weather (ini`s) , lightning files, col files and many textures files.
    This is a huge puzzle ... that everything .. to vote ..have fun

    They never asked themselves... why the game is so dark?
    There they have their problem.
     
  10. Myth

    Myth Master Mariner

    Joined:
    Mar 25, 2014
    Messages:
    203
    Gender:
    Male
    Delete all col files, move to line like in my past messeage. But night is to dark.
     
  11. Myth

    Myth Master Mariner

    Joined:
    Mar 25, 2014
    Messages:
    203
    Gender:
    Male
    MEGA - good for day. But for night its bad.
     

    Attached Files:

  12. Jan Marten

    Jan Marten de ZeeRoovers Group Storm Modder

    Joined:
    Sep 27, 2008
    Messages:
    440
    Gender:
    Male
    col files ... are one of the 5 building blocks of lighting.
    Why delete them? They are always created only for one .gm model.
     
  13. Jan Marten

    Jan Marten de ZeeRoovers Group Storm Modder

    Joined:
    Sep 27, 2008
    Messages:
    440
    Gender:
    Male
    @Myth
    (Pirates on the Storm 08.09.2017 10_11_28.mp4)
    The fog .... set it correctly.
     
  14. Myth

    Myth Master Mariner

    Joined:
    Mar 25, 2014
    Messages:
    203
    Gender:
    Male
    Has already solved the question.
     
  15. ChezJfrey

    ChezJfrey Master Mariner Storm Modder

    Joined:
    Apr 24, 2015
    Messages:
    226
    The LocationModelBlend is the technique block that contains the DirectX commands correlated to SetRenderState calls. At the moment, it appears to only be used in the jungle/scenes outside town, but I'm sure one could write their own technique block and add that same attribute to other locations if desired. LocationModelBlend block is written in modules\techniques\maineffects.sha; look for the block LocationModelBlend section.

    IDirect3DDevice9::SetRenderState method (Windows)

    The left side of the equation in the pass p0 part, correlates to the particular render state and the name is usually easy to determine which renderstate it will affect:

    D3DRENDERSTATETYPE enumeration (Windows)

    Example: lighting will set D3DRS_LIGHTING, ambient will set D3DRS_AMBIENT, fogenable will set D3DRS_FOGENABLE, etc. Some of the right side of the = will set true/false, while others will get some integer value, depending on how DirectX desires the value for the particular state you are setting.

    There is also another way built into the game to set ambient lighting, using loc_ambient.sha, but it doesn't work and has no effect. The developers intended to use the ambient settings in that file to affect the ambient light shades while inside different locations such as cave, house, tavern, etc. You can see this in the LoadLocation() function of locations_loader.c. However, as I mentioned, though it does call ExecuteTechnique in the back-end engine, it is done at the wrong time of the DirectX pipeline process, so has no effect on the ambient lighting at all; those render states need to be called at a different time. I am going to change the engine to enable that feature.
     
  16. Myth

    Myth Master Mariner

    Joined:
    Mar 25, 2014
    Messages:
    203
    Gender:
    Male
    I wonder how the game will look if you add the light that you mentioned.
     
  17. ChezJfrey

    ChezJfrey Master Mariner Storm Modder

    Joined:
    Apr 24, 2015
    Messages:
    226
    I just got this coded into the engine yesterday and started experimenting with different ambient light values in some locations.

    Now, the tavern shows an orangish light in the tavern, due to the firelight/candlelight, caves and dungeon are much dimmer; I'm still playing with numbers, but I like the fact that the intended effect now works, when it had no effect before. It now allows a little flexibility into how different location scenes are now rendered.
     

Share This Page