Jump to content

Any advanced scripters out there want to give this long script a look? Also, need some texturing help.


Recommended Posts

I'm working on a new mod called "LAGO - Linearly Aligning Geometric Objects."

 

Basically, I'm making Lego blocks. They are supposed to snap together like their real-world counterparts. The script I'm writing for them is, to put it mildly, driving me insane.

 

The script is supposed to do, in essence, four things: 1. Orient itself to upright when released from the player's grip, 2. Request nearby blocks position data, 3. Orient itself to the nearest block, and 4. Send position data when a released block nearby requests it.

 

I can't seem to get past the first part. When I release a block, it tries to translate to x0, y0, whether there is a close block or not.

 

The script is in the spoiler, and I've linked a 7z of the mod so far, if you want to see what it does.

 

As for the texturing, I've downloaded a bunch of badass textures from a guy's blog (he allows any use, and of course I will credit/link/Ko-Fi him on the mod page). They include spec and normal maps, but they are... off (have weird shadows/lighting) in game and the Creation Kit (the textures look fine in NifSkope).

 

GKX Lago.7z Google Drive Link

 

 

  Reveal hidden contents

 

Link to comment
Share on other sites

My suggestion would be to start adding debug.trace calls in your code to see exactly what is going on. There are simply too many variables and too much complexity to figure out at a glance what exactly is causing the problem (and unfortunately I don't have the time to try and run the mod). Cool idea, though.

 

As an aside, I would suggest you look into changing how you are interacting with your DataIndex / ClosedBlock code, especially your RequestLocations / SendMyLocation events, because it is going to send that to every single instance of your _gkx_lagoblocks, all at once. I can pretty much guarantee you that once you hit a certain number of blocks you will crash the game due to a Papyrus stack overflow. I know this from my own experience in creating a lighting mod for Fallout 4 (and the crashes will likely occur on consoles / older PCs even if you can't reproduce it on your own machine). I would suggest that you change the code to send data to specific blocks in the given radius rather than to every block (which would just be a call to a new function on a specific Objectreference).

Link to comment
Share on other sites

for textures, you have only included one of a white brick wall. it looks quite bad as in, it looks like it was much smaller originally and is now pixelated and low resolution at the size of 1024x1024. Tthe Spec and normal are not right for fallout. Spec looks far to bright and normal.. I have never seen that format. Any image can be converted to work in fallout, but its a lot to type. you seem smart, I have never understood scripting, so If you jus check some tutorial vids on how to convert textures to work in Fallout 4 or Skyrim, I'm sure you will figure it out.

Get Gimp photo editor for free and the DDs plugin for it found on github

Link to comment
Share on other sites

  On 4/12/2020 at 9:10 AM, GenghisKhanX said:

 

As for the texturing, I've downloaded a bunch of badass textures from a guy's blog (he allows any use, and of course I will credit/link/Ko-Fi him on the mod page). They include spec and normal maps, but they are... off (have weird shadows/lighting) in game and the Creation Kit (the textures look fine in NifSkope).

Textures need to be in the right format. I'm using BC3 for dif, BC5 for normals and specular. For further information, I would recommend to watch this vid https://www.youtube.com/watch?v=3cDJ0Rk7hC0

Secondly, as you may have noticed, you have a material file, which can greatly influence how the texture looks in game through different things such as specular multiplier, greyscaling, environment mapping, the used cube etc, so you might want to take a look into that as well/experiment with it.

Link to comment
Share on other sites

I realized after I downloaded them, the textures are 1k 72dpi jpegs. When I get my stimulus money, I'll toss the guy some patreon money for the 4k textures.

 

I did save the normal and speculars as BC5 and the diffuse as BC3, and I used a brick wall BGSM from the game files and just replaced the textures. I don't know,

 

Elric messed up my model. It stripped out the collision data completely...

 

As for the script, I'll do what Reneer suggested

 

Thanks everyone

~GKX

Link to comment
Share on other sites

  On 4/12/2020 at 4:47 PM, GenghisKhanX said:

I realized after I downloaded them, the textures are 1k 72dpi jpegs. When I get my stimulus money, I'll toss the guy some patreon money for the 4k textures.

 

I did save the normal and speculars as BC5 and the diffuse as BC3, and I used a brick wall BGSM from the game files and just replaced the textures. I don't know,

 

Elric messed up my model. It stripped out the collision data completely...

 

As for the script, I'll do what Reneer suggested

 

Thanks everyone

~GKX

If it's the normal brickwall bgsm then it greyscales to a pallet, if I remember it correctly. Try to get rid of the greyscaling and see if this helps.

Edited by DocMoebius
Link to comment
Share on other sites

  On 4/12/2020 at 4:47 PM, GenghisKhanX said:

As for the script, I'll do what Reneer suggested

If you have any further trouble figuring out what the problem is, feel free to PM me or post again here and I'll be happy to help as best I can.
Link to comment
Share on other sites

GenghisKhanX wrote: "I cannot seem to get past the first part. When I release a block, it tries to translate to x0, y0, whether there is a close block or not."

 

1. What is a threadlock?

        WHILE (Busy1)
            Utility.Wait(0.1)    ; Threadlock 1 active
        ENDWHILE

        Busy1 = TRUE        ; *T*
;        ------------
       ; code inside that manipulates script data (variables and/or porperties) and may not interrupted
;        ------------
        Busy1 = False        ; ***

2. How to init an array or a struct variable (user defined record of given types)?

    CloseBlocks = new PositionData[0]        ; create new array (with userdefined struct) of ZERO length
    PositionData PD = new PositionData       ; create new struct

3. Make sure you do not have to many "wait()" inside your code. Its horrible to debug, because of event calling by threads.

 

4. _gkx_lagoblocks

  Reveal hidden contents

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...