Jump to content

Issues with changing model via script


JustChill

Recommended Posts

Hey there,

 

I tried to make some presets for my Dynamic Pipboy Light mod, where either the meshes change to represent the correct glow color.

However, changing the meshes seem not to work:

scn DPLightChangePresEXT
;=> This UDF will be called, when the player changes the preset in the MCM menu.
;=> I either planned to call it when transfering between interior and exterior, but it doesn't work right now,
;=> so I don't see any reason to continue on the overall functionality, when the model change cannot get applied.
;=> First I need to fix that. :/
Begin Function{}
    if DPLOPQuest.DPLColPreset == 0        ;=> Default green glow color
        ;before I switch the model I change the RGB values of the Pipboy light to the respective ones.
        SetBipedModelPathAlt PipBoy 0 "pipboy3000\PipBoyArm.nif"
        SetBipedModelPathAlt PipBoy 1 "pipboy3000\PipBoyArmFemale.nif"
        SetBipedModelPathAlt PipBoy 2 "pipboy3000\PipBoyArm.nif"
        SetBipedModelPathAlt PipBoy 3 "pipboy3000\PipBoyArmFemale.nif"
        SetBipedModelPathAlt PimpBoy 0 "pipboy3billion\PipBoyArm.nif"
        SetBipedModelPathAlt PimpBoy 1 "pipboy3billion\PipBoyArm.nif"
        SetBipedModelPathAlt PimpBoy 2 "pipboy3billion\PipBoyArm.nif"
        SetBipedModelPathAlt PimpBoy 3 "pipboy3billion\PipBoyArm.nif"
        Player.ReloadEquippedModels
    elseif     if DPLOPQuest.DPLColPreset == 1    ;=> Red
        ;before I switch the model I change the RGB values of the Pipboy light to the respective ones.
        SetBipedModelPathAlt PipBoy 0 "pipboy3000\Sarge198\red\PipBoyArm.nif"
        SetBipedModelPathAlt PipBoy 1 "pipboy3000\Sarge198\red\PipBoyArmFemale.nif"
        SetBipedModelPathAlt PipBoy 2 "pipboy3000\Sarge198\red\PipBoyArm.nif"
        SetBipedModelPathAlt PipBoy 3 "pipboy3000\Sarge198\red\PipBoyArmFemale.nif"
        SetBipedModelPathAlt PimpBoy 0 "pipboy3billion\Sarge198\red\PipBoyArm.nif"
        SetBipedModelPathAlt PimpBoy 1 "pipboy3billion\Sarge198\red\PipBoyArmFemale.nif"
        SetBipedModelPathAlt PimpBoy 2 "pipboy3billion\Sarge198\red\PipBoyArm.nif"
        SetBipedModelPathAlt PimpBoy 3 "pipboy3billion\Sarge198\red\PipBoyArmFemale.nif"
        Player.ReloadEquippedModels
    elseif     if DPLOPQuest.DPLColPreset == 2    ;=> Default White
        ;before I switch the model I change the RGB values of the Pipboy light to the respective ones.
        SetBipedModelPathAlt PipBoy 0 "pipboy3000\Sarge198\White\PipBoyArm.nif"
        SetBipedModelPathAlt PipBoy 1 "pipboy3000\Sarge198\White\PipBoyArmFemale.nif"
        SetBipedModelPathAlt PipBoy 2 "pipboy3000\Sarge198\White\PipBoyArm.nif"
        SetBipedModelPathAlt PipBoy 3 "pipboy3000\Sarge198\White\PipBoyArmFemale.nif"
        SetBipedModelPathAlt PimpBoy 0 "pipboy3billion\Sarge198\White\PipBoyArm.nif"
        SetBipedModelPathAlt PimpBoy 1 "pipboy3billion\Sarge198\White\PipBoyArmFemale.nif"
        SetBipedModelPathAlt PimpBoy 2 "pipboy3billion\Sarge198\White\PipBoyArm.nif"
        SetBipedModelPathAlt PimpBoy 3 "pipboy3billion\Sarge198\White\PipBoyArmFemale.nif"
        Player.ReloadEquippedModels        
    elseif     if DPLOPQuest.DPLColPreset == 3    ;=> Default Blue
        ;before I switch the model I change the RGB values of the Pipboy light to the respective ones.
        SetBipedModelPathAlt PipBoy 0 "pipboy3000\Sarge198\Blue\PipBoyArm.nif"
        SetBipedModelPathAlt PipBoy 1 "pipboy3000\Sarge198\Blue\PipBoyArmFemale.nif"
        SetBipedModelPathAlt PipBoy 2 "pipboy3000\Sarge198\Blue\PipBoyArm.nif"
        SetBipedModelPathAlt PipBoy 3 "pipboy3000\Sarge198\Blue\PipBoyArmFemale.nif"
        SetBipedModelPathAlt PimpBoy 0 "pipboy3billion\Sarge198\Blue\PipBoyArm.nif"
        SetBipedModelPathAlt PimpBoy 1 "pipboy3billion\Sarge198\Blue\PipBoyArmFemale.nif"
        SetBipedModelPathAlt PimpBoy 2 "pipboy3billion\Sarge198\Blue\PipBoyArm.nif"
        SetBipedModelPathAlt PimpBoy 3 "pipboy3billion\Sarge198\Blue\PipBoyArmFemale.nif"
        Player.ReloadEquippedModels
    elseif     if DPLOPQuest.DPLColPreset == 4    ;=> Default Amber
        ;before I switch the model I change the RGB values of the Pipboy light to the respective ones.
        SetBipedModelPathAlt PipBoy 0 "pipboy3000\Sarge198\Amber\PipBoyArm.nif"
        SetBipedModelPathAlt PipBoy 1 "pipboy3000\Sarge198\Amber\PipBoyArmFemale.nif"
        SetBipedModelPathAlt PipBoy 2 "pipboy3000\Sarge198\Amber\PipBoyArm.nif"
        SetBipedModelPathAlt PipBoy 3 "pipboy3000\Sarge198\Amber\PipBoyArmFemale.nif"
        SetBipedModelPathAlt PimpBoy 0 "pipboy3billion\Sarge198\Amber\PipBoyArm.nif"
        SetBipedModelPathAlt PimpBoy 1 "pipboy3billion\Sarge198\Amber\PipBoyArmFemale.nif"
        SetBipedModelPathAlt PimpBoy 2 "pipboy3billion\Sarge198\Amber\PipBoyArm.nif"
        SetBipedModelPathAlt PimpBoy 3 "pipboy3billion\Sarge198\Amber\PipBoyArmFemale.nif"
        Player.ReloadEquippedModels
    endif
End

Does anyone know what I am doing wrong?

 

I always have the green glow. :sad:

The mesh path is correct (I either tried with "meshes\" in front of the path), but the new model doesn't want to get applied. :sad:

Link to comment
Share on other sites

Alright, I just debugged.

The model path is correctly set to the new one. As checked by GetBipedModelPath printed via string_var in printc.

I either tried "Player.ReloadEquippedModels" in console. Still no luck. :(

 

Yet the color of the glow which emerges from the Pip Boy display still stays green.

I was thinking of creating a dummy Pip Boy for each color and simply equip these, but this will be a lot dirtier than a direkt model change.

 

I have no idea why that's not working though. :sad:

Link to comment
Share on other sites

Alright, this solution works pretty well for the menu mode (it's an UDF):

 

 

scn DPLightPresChange

Short DPLightON
Short DPLWhichOne

Begin Function{}
    if DPLightOPQuest.DPLightIntMode
        if player.isininterior
            if DPLightOPQuest.DPLActColPresI
                if player.hasmagiceffect piplight
                    Let DPLightON := 1
                    TogglePipboyLight 0
                endif
                if Player.GetEquipped Pipboy
                    SetPutdownSound Pipboy DPLSilentPipboy
                    Player.UnEquipItem Pipboy 0 1
                    Let DPLWhichOne := 1
                elseif Player.GetEquipped Pimpboy
                    SetPutdownSound Pimpboy DPLSilentPipboy
                    Player.UnEquipItem Pimpboy 0 1
                    Let DPLWhichOne := 2
                endif
                if DPLightOPQuest.DPLColPresetI == 0
                    if DPLWhichOne == 1
                        SetBipedModelPathAlt Pipboy 0 "pipboy3000\Sarge198\green\pipboyarm.nif"
                        SetBipedModelPathAlt Pipboy 1 "pipboy3000\Sarge198\green\PipBoyArmFemale.nif"
                        SetBipedModelPathAlt Pipboy 2 "pipboy3000\Sarge198\green\PipBoyArm.nif"
                        SetBipedModelPathAlt Pipboy 3 "pipboy3000\Sarge198\green\PipBoyArmFemale.nif"
                    elseif DPLWhichOne == 2
                        SetBipedModelPathAlt PimpBoy 0 "pimpboy3billion\Sarge198\amber\PipBoyArm.nif"
                        SetBipedModelPathAlt PimpBoy 1 "pimpboy3billion\Sarge198\amber\PipBoyArmFemale.nif"
                        SetBipedModelPathAlt PimpBoy 2 "pimpboy3billion\Sarge198\amber\PipBoyArm.nif"
                        SetBipedModelPathAlt PimpBoy 3 "pimpboy3billion\Sarge198\amber\PipBoyArmFemale.nif"
                    endif
                elseif DPLightOPQuest.DPLColPresetI == 1
                    if DPLWhichOne == 1
                        SetBipedModelPathAlt Pipboy 0 "pipboy3000\Sarge198\amber\pipboyarm.nif"
                        SetBipedModelPathAlt Pipboy 1 "pipboy3000\Sarge198\Amber\PipBoyArmFemale.nif"
                        SetBipedModelPathAlt Pipboy 2 "pipboy3000\Sarge198\Amber\PipBoyArm.nif"
                        SetBipedModelPathAlt Pipboy 3 "pipboy3000\Sarge198\Amber\PipBoyArmFemale.nif"
                    elseif DPLWhichOne == 2
                        SetBipedModelPathAlt PimpBoy 0 "pimpboy3billion\Sarge198\Green\PipBoyArm.nif"
                        SetBipedModelPathAlt PimpBoy 1 "pimpboy3billion\Sarge198\Green\PipBoyArmFemale.nif"
                        SetBipedModelPathAlt PimpBoy 2 "pimpboy3billion\Sarge198\Green\PipBoyArm.nif"
                        SetBipedModelPathAlt PimpBoy 3 "pimpboy3billion\Sarge198\Green\PipBoyArmFemale.nif"
                    endif
                elseif DPLightOPQuest.DPLColPresetI == 2
                    if DPLWhichOne > 0
                        SetBipedModelPathAlt Pipboy 0 "pipboy3000\Sarge198\red\PipBoyArm.nif"
                        SetBipedModelPathAlt Pipboy 1 "pipboy3000\Sarge198\red\PipBoyArmFemale.nif"
                        SetBipedModelPathAlt Pipboy 2 "pipboy3000\Sarge198\red\PipBoyArm.nif"
                        SetBipedModelPathAlt Pipboy 3 "pipboy3000\Sarge198\red\PipBoyArmFemale.nif"
                        SetBipedModelPathAlt PimpBoy 0 "pimpboy3billion\Sarge198\red\PipBoyArm.nif"
                        SetBipedModelPathAlt PimpBoy 1 "pimpboy3billion\Sarge198\red\PipBoyArmFemale.nif"
                        SetBipedModelPathAlt PimpBoy 2 "pimpboy3billion\Sarge198\red\PipBoyArm.nif"
                        SetBipedModelPathAlt PimpBoy 3 "pimpboy3billion\Sarge198\red\PipBoyArmFemale.nif"
                    endif
                elseif DPLightOPQuest.DPLColPresetI == 3
                    if DPLWhichOne > 0
                        SetBipedModelPathAlt Pipboy 0 "pipboy3000\Sarge198\White\PipBoyArm.nif"
                        SetBipedModelPathAlt Pipboy 1 "pipboy3000\Sarge198\White\PipBoyArmFemale.nif"
                        SetBipedModelPathAlt Pipboy 2 "pipboy3000\Sarge198\White\PipBoyArm.nif"
                        SetBipedModelPathAlt Pipboy 3 "pipboy3000\Sarge198\White\PipBoyArmFemale.nif"
                        SetBipedModelPathAlt PimpBoy 0 "pimpboy3billion\Sarge198\White\PipBoyArm.nif"
                        SetBipedModelPathAlt PimpBoy 1 "pimpboy3billion\Sarge198\White\PipBoyArmFemale.nif"
                        SetBipedModelPathAlt PimpBoy 2 "pimpboy3billion\Sarge198\White\PipBoyArm.nif"
                        SetBipedModelPathAlt PimpBoy 3 "pimpboy3billion\Sarge198\White\PipBoyArmFemale.nif"
                    endif
                elseif DPLightOPQuest.DPLColPresetI == 4
                    if DPLWhichOne > 0
                        SetBipedModelPathAlt Pipboy 0 "pipboy3000\Sarge198\Blue\PipBoyArm.nif"
                        SetBipedModelPathAlt Pipboy 1 "pipboy3000\Sarge198\Blue\PipBoyArmFemale.nif"
                        SetBipedModelPathAlt Pipboy 2 "pipboy3000\Sarge198\Blue\PipBoyArm.nif"
                        SetBipedModelPathAlt Pipboy 3 "pipboy3000\Sarge198\Blue\PipBoyArmFemale.nif"
                        SetBipedModelPathAlt PimpBoy 0 "pimpboy3billion\Sarge198\Blue\PipBoyArm.nif"
                        SetBipedModelPathAlt PimpBoy 1 "pimpboy3billion\Sarge198\Blue\PipBoyArmFemale.nif"
                        SetBipedModelPathAlt PimpBoy 2 "pimpboy3billion\Sarge198\Blue\PipBoyArm.nif"
                        SetBipedModelPathAlt PimpBoy 3 "pimpboy3billion\Sarge198\Blue\PipBoyArmFemale.nif"
                    endif
                endif
                Player.ReloadEquippedModels    ;=> This is necessary, to get the model not stuck on the light glow even if the light is off.
                if DPLWhichOne == 1
                    SetPickupSound Pipboy DPLSilentPipBoy
                    Player.EquipItem Pipboy 0 1
                    Let DPLWhichOne := 0
                    SetPickupSound Pipboy UIPipBoyClampOn
                    SetPutdownSound Pipboy UIItemGenericDown
                elseif DPLWhichOne == 2
                    SetPickupSound Pimpboy DPLSilentPipBoy
                    Player.EquipItem Pimpboy 0 1
                    Let DPLWhichOne := 0
                    SetPickupSound Pimpboy UIPipBoyClampOn
                    SetPutdownSound Pimpboy UIItemGenericDown
                elseif DPLWhichOne > 0
                    Let DPLWhichOne := 0
                endif
                if DPLightON
                    TogglePipboyLight 1
                    Let DPLightON := 0
                endif
            endif
        endif
    else
        if player.isininterior
        else
            if DPLightOPQuest.DPLActColPres
                if player.hasmagiceffect piplight
                    Let DPLightON := 1
                    TogglePipboyLight 0
                endif
                if Player.GetEquipped Pipboy
                    SetPutdownSound Pipboy DPLSilentPipboy
                    Player.UnEquipItem Pipboy 0 1
                    Let DPLWhichOne := 1
                elseif Player.GetEquipped Pimpboy
                    SetPutdownSound Pimpboy DPLSilentPipboy
                    Player.UnEquipItem Pimpboy 0 1
                    Let DPLWhichOne := 2
                endif
                if DPLightOPQuest.DPLColPreset == 0
                    if DPLWhichOne == 1
                        SetBipedModelPathAlt Pipboy 0 "pipboy3000\Sarge198\green\pipboyarm.nif"
                        SetBipedModelPathAlt Pipboy 1 "pipboy3000\Sarge198\green\PipBoyArmFemale.nif"
                        SetBipedModelPathAlt Pipboy 2 "pipboy3000\Sarge198\green\PipBoyArm.nif"
                        SetBipedModelPathAlt Pipboy 3 "pipboy3000\Sarge198\green\PipBoyArmFemale.nif"
                    elseif DPLWhichOne == 2
                        SetBipedModelPathAlt PimpBoy 0 "pimpboy3billion\Sarge198\amber\PipBoyArm.nif"
                        SetBipedModelPathAlt PimpBoy 1 "pimpboy3billion\Sarge198\amber\PipBoyArmFemale.nif"
                        SetBipedModelPathAlt PimpBoy 2 "pimpboy3billion\Sarge198\amber\PipBoyArm.nif"
                        SetBipedModelPathAlt PimpBoy 3 "pimpboy3billion\Sarge198\amber\PipBoyArmFemale.nif"
                    endif
                elseif DPLightOPQuest.DPLColPreset == 1
                    if DPLWhichOne == 1
                        SetBipedModelPathAlt Pipboy 0 "pipboy3000\Sarge198\amber\pipboyarm.nif"
                        SetBipedModelPathAlt Pipboy 1 "pipboy3000\Sarge198\Amber\PipBoyArmFemale.nif"
                        SetBipedModelPathAlt Pipboy 2 "pipboy3000\Sarge198\Amber\PipBoyArm.nif"
                        SetBipedModelPathAlt Pipboy 3 "pipboy3000\Sarge198\Amber\PipBoyArmFemale.nif"
                    elseif DPLWhichOne == 2
                        SetBipedModelPathAlt PimpBoy 0 "pimpboy3billion\Sarge198\Green\PipBoyArm.nif"
                        SetBipedModelPathAlt PimpBoy 1 "pimpboy3billion\Sarge198\Green\PipBoyArmFemale.nif"
                        SetBipedModelPathAlt PimpBoy 2 "pimpboy3billion\Sarge198\Green\PipBoyArm.nif"
                        SetBipedModelPathAlt PimpBoy 3 "pimpboy3billion\Sarge198\Green\PipBoyArmFemale.nif"
                    endif
                elseif DPLightOPQuest.DPLColPreset == 2
                    if DPLWhichOne > 0
                        SetBipedModelPathAlt Pipboy 0 "pipboy3000\Sarge198\red\PipBoyArm.nif"
                        SetBipedModelPathAlt Pipboy 1 "pipboy3000\Sarge198\red\PipBoyArmFemale.nif"
                        SetBipedModelPathAlt Pipboy 2 "pipboy3000\Sarge198\red\PipBoyArm.nif"
                        SetBipedModelPathAlt Pipboy 3 "pipboy3000\Sarge198\red\PipBoyArmFemale.nif"
                        SetBipedModelPathAlt PimpBoy 0 "pimpboy3billion\Sarge198\red\PipBoyArm.nif"
                        SetBipedModelPathAlt PimpBoy 1 "pimpboy3billion\Sarge198\red\PipBoyArmFemale.nif"
                        SetBipedModelPathAlt PimpBoy 2 "pimpboy3billion\Sarge198\red\PipBoyArm.nif"
                        SetBipedModelPathAlt PimpBoy 3 "pimpboy3billion\Sarge198\red\PipBoyArmFemale.nif"
                    endif
                elseif DPLightOPQuest.DPLColPreset == 3
                    if DPLWhichOne > 0
                        SetBipedModelPathAlt Pipboy 0 "pipboy3000\Sarge198\White\PipBoyArm.nif"
                        SetBipedModelPathAlt Pipboy 1 "pipboy3000\Sarge198\White\PipBoyArmFemale.nif"
                        SetBipedModelPathAlt Pipboy 2 "pipboy3000\Sarge198\White\PipBoyArm.nif"
                        SetBipedModelPathAlt Pipboy 3 "pipboy3000\Sarge198\White\PipBoyArmFemale.nif"
                        SetBipedModelPathAlt PimpBoy 0 "pimpboy3billion\Sarge198\White\PipBoyArm.nif"
                        SetBipedModelPathAlt PimpBoy 1 "pimpboy3billion\Sarge198\White\PipBoyArmFemale.nif"
                        SetBipedModelPathAlt PimpBoy 2 "pimpboy3billion\Sarge198\White\PipBoyArm.nif"
                        SetBipedModelPathAlt PimpBoy 3 "pimpboy3billion\Sarge198\White\PipBoyArmFemale.nif"
                    endif
                elseif DPLightOPQuest.DPLColPreset == 4
                    if DPLWhichOne > 0
                        SetBipedModelPathAlt Pipboy 0 "pipboy3000\Sarge198\Blue\PipBoyArm.nif"
                        SetBipedModelPathAlt Pipboy 1 "pipboy3000\Sarge198\Blue\PipBoyArmFemale.nif"
                        SetBipedModelPathAlt Pipboy 2 "pipboy3000\Sarge198\Blue\PipBoyArm.nif"
                        SetBipedModelPathAlt Pipboy 3 "pipboy3000\Sarge198\Blue\PipBoyArmFemale.nif"
                        SetBipedModelPathAlt PimpBoy 0 "pimpboy3billion\Sarge198\Blue\PipBoyArm.nif"
                        SetBipedModelPathAlt PimpBoy 1 "pimpboy3billion\Sarge198\Blue\PipBoyArmFemale.nif"
                        SetBipedModelPathAlt PimpBoy 2 "pimpboy3billion\Sarge198\Blue\PipBoyArm.nif"
                        SetBipedModelPathAlt PimpBoy 3 "pimpboy3billion\Sarge198\Blue\PipBoyArmFemale.nif"
                    endif
                endif
                Player.ReloadEquippedModels
                if DPLWhichOne == 1
                    SetPickupSound Pipboy DPLSilentPipBoy
                    Player.EquipItem Pipboy 0 1
                    Let DPLWhichOne := 0
                    SetPickupSound Pipboy UIPipBoyClampOn
                    SetPutdownSound Pipboy UIItemGenericDown
                elseif DPLWhichOne == 2
                    SetPickupSound Pimpboy DPLSilentPipBoy
                    Player.EquipItem Pimpboy 0 1
                    Let DPLWhichOne := 0
                    SetPickupSound Pimpboy UIPipBoyClampOn
                    SetPutdownSound Pimpboy UIItemGenericDown
                elseif DPLWhichOne > 0
                    Let DPLWhichOne := 0
                endif
                if DPLightON
                    TogglePipboyLight 1
                    Let DPLightON := 0
                endif
            endif
        endif
    endif
End

 

 

 

I was a bit irritated that there is no option to mute the Equip- and UnEquip-sound.

Therefore I used 2 Lutana functions for changing the actual sound with an empty one (1 second mute WAV file) and afterwards I re-apply the default sound.

Works like a charm.

 

Except... This solution is only good for the menu mode. I have no issues, when I pick the presets in MCM and change them. The model changes dynamically with the settings.

But when I try to Call that UDF in GameMode (after cell transition and in GetGameLoaded), I end up with no PipBoy equipped and the player has a Rayman arm, where the PipBoy was. XD

 

So it seems I have to come up with a completely different solution, when I try to dynamically change the model in GameMode block. :/

 

 

 

 

Well...

I just released V3.0.

Even though... I had to do a LOT changes to the script stated here. XD

Link to comment
Share on other sites

  • Recently Browsing   0 members

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