Jump to content

Recommended Posts

5 minutes ago, Doodle Monster said:

wramp.luaUnavailable

It might be because I didn't include the fx in my prefab files 

Not sure that would cause this, but it might

Well that file unfortunately isn't loading on the forums :-?

You shouldn't have to include it, so idk. I did get the fx working on my end like this,

-- In master_postinit
inst.components.combat.onhitotherfn = WrampShadowWeaponFx

-- Outside and above master_postinit
local function WrampShadowWeaponFx(inst, target)
  if (inst.components.sanity and inst.components.sanity:GetPercent() <= .5) and target ~= nil and target:IsValid() then -- If sanity is below 50% and target is valid, skipping the other if statement.
    local fx_prefab = "wanda_attack_shadowweapon_old_fx"
    
    if fx_prefab ~= nil then -- Makes sure the fx prefab name was given before trying to spawn it
		local fx = SpawnPrefab(fx_prefab) -- Spawns the fx
		local x, y, z = target.Transform:GetWorldPosition() -- Gets the target's world position
		local radius = target:GetPhysicsRadius(.5) -- Get target's radius
		local angle = (inst.Transform:GetRotation() - 90) * DEGREES -- Get target's angle
		fx.Transform:SetPosition(x + math.sin(angle) * radius, 0, z + math.cos(angle) * radius) -- Moves the fx to the same position in the world as the target
	end
  end
end

This is kinda the absolute bare minimum required to make it function

4 minutes ago, Doodle Monster said:

Where do I put the function? I had it above local function onload

wramp.lua 5.58 kB · 1 download

I believe the 'and print("NORMAL_FX")' is whats currently breaking it. Change it from this

local fx_prefab = "wanda_attack_shadowweapon_normal_fx" and print("NORMAL FX")
	or nil

to just this

local fx_prefab = "wanda_attack_shadowweapon_normal_fx"

 

2 minutes ago, Merkyrrie said:

I believe the 'and print("NORMAL_FX")' is whats currently breaking it. Change it from this

local fx_prefab = "wanda_attack_shadowweapon_normal_fx" and print("NORMAL FX")
	or nil

to just this

local fx_prefab = "wanda_attack_shadowweapon_normal_fx"

 

and change the start of the function to this

local function WrampShadowWeaponFx(inst, target, damage, stimuli, weapon)

 

I got this crash once I loaded into the server

[string "scripts/mainfunctions.lua"]:160: Error loading file prefabs/wramp
[string "../mods/Wramp Clothier Damage effect rewrite/scripts/prefabs/wr..."]:161: ')' expected near 'WrampShadowWeaponFx'
LUA ERROR stack traceback:
        =[C] in function 'assert'
        scripts/mainfunctions.lua(160,1)
        =(tail call) ?
        =[C] in function 'xpcall'
        scripts/mods.lua(189,1)
        scripts/mods.lua(666,1) in function '_RegisterPrefabs'
        local MS_MODNAME = 'workshop-2812783478';local a = {}

 

Edited by Doodle Monster
2 minutes ago, Doodle Monster said:

I got this crash once I loaded into the server

[string "scripts/mainfunctions.lua"]:160: Error loading file prefabs/wramp
[string "../mods/Wramp Clothier Damage effect rewrite/scripts/prefabs/wr..."]:161: ')' expected near 'WrampShadowWeaponFx'
LUA ERROR stack traceback:
        =[C] in function 'assert'
        scripts/mainfunctions.lua(160,1)
        =(tail call) ?
        =[C] in function 'xpcall'
        scripts/mods.lua(189,1)
        scripts/mods.lua(666,1) in function '_RegisterPrefabs'
        local MS_MODNAME = 'workshop-2812783478';local a = {}

 

would mean you're missing a closing parenthesis on line 161 of the wramp.lua file

2 minutes ago, Doodle Monster said:

This is line 161, I think it has closeing parethesis

    inst:ListenForEvent("sanitydelta," WrampShadowWeaponFx)

 

Yeah, which means you are correct its for a missing one further up somewhere

43 minutes ago, Doodle Monster said:

It works! Thank you so much for the help! Do you want me to mention you for credit in the mod description?

 

 

No problem! You can if you'd like to, but there's really no need. Good luck with the rest of the mod!

On 4/4/2025 at 2:39 PM, Doodle Monster said:

@oregu Sorry for the ping! You seemed more knowlegeable then me on this, any help or pointers would be awesome.

Again, I somehow did not receive the notification! But I can try to work on this.

Edit: Nevermind, I guess. Glad you all found a solution.

Edited by oregu

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...