Jump to content

just need some pointers. if someone is willing to help. my mod is almost done


Recommended Posts

hey guys. ok so ive been at this for a while now and i have been running into some issues. and i dont know why. keep in mind i used the default esctemplate. and imported a few things from other mods to help guide me to where i am now.

1) even though i posted this before i cant get the item to appear on the ground when it is dropped.

 

2)im trying to get a weapon to do the over_charge sound from wx87 sound file. but the sound doesnt play

 

3) im trying to get the weapon to do the function from the book "the end is neigh" but cant seem to get that to work. 

 

4)how do i write the code for getting the weapon to decrease the players hunger

 

please be specific as im fairly new to all of this and writting out the code is greatly appreciated. im sorry if i cause anyone trouble, but this has bee frustrating me, i know i can get this to work and i would like my character to be the way i want it before i send it to the workshop.

 

anyways if anyone gets back to me i thank you in advance

Link to comment
Share on other sites

so i just got something to work but it also doesnt at the same time

 

 local pt = Vector3(inst.Transform:GetWorldPosition())
    local num_lightnings = 16
 
    inst:StartThread(function()
        for k = 0, num_lightnings do
            local rad = math.random(3, 15)
            local angle = k * 4 * PI / num_lightnings
            local pos = pt + Vector3(rad * math.cos(angle), 0, rad * math.sin(angle))
            TheWorld:PushEvent("ms_sendlightningstrike", pos)
            Sleep(math.random( .3, .5))
        end
    end)
 
 
this worked to appearantly spawn lightning. but for some reason i dont see the lightning only hear the sound and the screen goes dark. and no effect takes place. 
 
could this be becuz im using wx87 lightning strike code as a base for my character?
Link to comment
Share on other sites

 i commented out the code for wx87 base code and still getting the same issue. so it cant be that. what am i doing wrong. all you masters out there can probably see the problem better than i can

Edited by dragonacool
Link to comment
Share on other sites

PrefabFiles = {	"zapper","tm24", "tm24_projectile",}Assets = {    Asset( "IMAGE", "images/saveslot_portraits/zapper.tex" ),    Asset( "ATLAS", "images/saveslot_portraits/zapper.xml" ),    Asset( "IMAGE", "images/selectscreen_portraits/zapper.tex" ),    Asset( "ATLAS", "images/selectscreen_portraits/zapper.xml" ),	    Asset( "IMAGE", "images/selectscreen_portraits/zapper_silho.tex" ),    Asset( "ATLAS", "images/selectscreen_portraits/zapper_silho.xml" ),    Asset( "IMAGE", "bigportraits/zapper.tex" ),    Asset( "ATLAS", "bigportraits/zapper.xml" ),		Asset( "IMAGE", "images/map_icons/zapper.tex" ),	Asset( "ATLAS", "images/map_icons/zapper.xml" ),		Asset( "IMAGE", "images/avatars/avatar_zapper.tex" ),    Asset( "ATLAS", "images/avatars/avatar_zapper.xml" ),		Asset( "IMAGE", "images/avatars/avatar_ghost_zapper.tex" ),    Asset( "ATLAS", "images/avatars/avatar_ghost_zapper.xml" ),}local require = GLOBAL.requirelocal STRINGS = GLOBAL.STRINGS-- The character select screen linesSTRINGS.CHARACTER_TITLES.zapper = "The Shocker"STRINGS.CHARACTER_NAMES.zapper = "Zapper"STRINGS.CHARACTER_DESCRIPTIONS.zapper = "*Super fast\n*Shocking Ranged attack\n*Only eats fruits and veggies"STRINGS.CHARACTER_QUOTES.zapper = "\"ZAPPER\""-- Custom speech stringsSTRINGS.CHARACTERS.ZAPPER = require "speech_zapper"-- The character's name as appears in-game STRINGS.NAMES.ZAPPER = "Zapper"-- The default responses of examining the characterSTRINGS.CHARACTERS.GENERIC.DESCRIBE.ZAPPER = {	GENERIC = "It's Zapper!",	ATTACKER = "That Zapper looks shocking...",	MURDERER = "Murderer!",	REVIVER = "Zapper, Glad you could give me a \"jump\"",	GHOST = "Zapper could use a Jolt.",}AddMinimapAtlas("images/map_icons/zapper.xml")-- Add mod character to mod character list. Also specify a gender. Possible genders are MALE, FEMALE, ROBOT, NEUTRAL, and PLURAL.AddModCharacter("zapper", "MALE")

 

Can you attach your modmain file please? It'll be easier for folks to help if they can see all the code, not just a snippet.

 

Link to comment
Share on other sites

@dragonacool, I attach my electrostaff.

 

Are you sure you want the end is nigh effect, and not a custom one?

Be sure to have a gigantic range or lightning rods, or a rain coat, or you are going to get destroyed.

 

I covered 2, 3, 4.

omg thank you so much. ok so i got it working. but you were right about me getting destroyed. i used wx87's prefab as a base to cope with the lightning strike but its not working. but i honestly cant thank you enough. if only i can get the lightning strike to not do any damage to me. after this there is just a few more thinsg for this mod and it will be complete. if i ever get any other issues can i count on your help? if thats not to much trouble

Link to comment
Share on other sites

@dragonacool, I attach my electrostaff.

 

Are you sure you want the end is nigh effect, and not a custom one?

Be sure to have a gigantic range or lightning rods, or a rain coat, or you are going to get destroyed.

 

I covered 2, 3, 4.

 

ok forget my last post i got it to work. i noticed i had deleted a few things from the original wx87 prefab. now lets say my character starts out weak (like wolfgang) but instead of eating. he becomes "normal" after 10 or so days. and then after he became normal he is able to eat a certain item that will make him "mighty" and would stay these forms and not go back. also he wouldnt be able to craft the "electric staff" until he became mighty. would this be difficult to do. i was trying to figure it out, and i dont know how i would be able to get the 10 days to work and the item specifics for each stage of his "mightiness".

Edited by dragonacool
Link to comment
Share on other sites

@dragonacool,

many ways to do it.

 

Example:

local N_days = 10 -- Days to livelocal function CheckForNormal(inst)	local age = inst.components.age:GetAgeInDays() -- Get my age	if age < N_days then -- Less than 10?		return -- Get out	end	inst:PushEvent("BeNormal", true) -- No? Alright, let's do go normalendlocal function CheckForMighty(inst, data)	if data.food.prefab == "dragonpie" then -- We eat a dragonpie?		inst:PushEvent("BeMighty", true) -- Aww yiss, mighty we go	endendlocal function Normalization(inst, fromWWS)	if fromWWS then -- We come from the WatchWorldState check, with the PushEvent with true?		inst:StopWatchingWorldState("startday", CheckForNormal) -- Cancel that shit	end	inst:AddTag("mightyable") -- We normal now, not yet there	inst:ListenForEvent("oneat", CheckForMighty) -- We listen for stuff we eat!endlocal function Mightlyzation(inst, fromLFE)	if fromLFE then -- We come from the ListenForEvent check, with the PushEvent with true?		inst:RemoveEventCallback("oneat", CheckForMighty) -- Cancel that shit	end	inst:AddTag("mightybuzz") -- We got mighty status now, can craft recipes with mightybuzz tag	if inst:HasTag("mightyable") then -- Best we get rid of the middleman tag		inst:RemoveTag("mightyable")	end	inst:AddTag("pyromaniac") -- Now I can craft recipes with pyromaniac tag requiredendlocal function OnSave(inst, data)	data.mightycraft = inst:HasTag("mightybuzz") -- We save if we mighty, age is saved anywaysendlocal function OnLoad(inst, data)	if data.mightycraft then -- We mighty? Let's go!		inst:PushEvent("BeMighty", false)	else -- Not mighty		local age = inst.components.age:GetAgeInDays() -- Get my age		if age < N_days then -- We normal?			inst:WatchWorldState("startday", CheckForNormal) -- No? Then let's wait		else			inst:PushEvent("BeNormal", false) -- Yes, let's go!		end	endend	-- in master_postinit	inst:ListenForEvent("BeNormal", Normalization)	inst:ListenForEvent("BeMighty", Mightlyzation)	inst.OnSave = OnSave    inst.OnLoad = OnLoad
  • Like 1
Link to comment
Share on other sites

 

@dragonacool,

many ways to do it.

 

Example:

local N_days = 10 -- Days to livelocal function CheckForNormal(inst)	local age = inst.components.age:GetAgeInDays() -- Get my age	if age < N_days then -- Less than 10?		return -- Get out	end	inst:PushEvent("BeNormal", true) -- No? Alright, let's do go normalendlocal function CheckForMighty(inst, data)	if data.food.prefab == "dragonpie" then -- We eat a dragonpie?		inst:PushEvent("BeMighty", true) -- Aww yiss, mighty we go	endendlocal function Normalization(inst, fromWWS)	if fromWWS then -- We come from the WatchWorldState check, with the PushEvent with true?		inst:StopWatchingWorldState("startday", CheckForNormal) -- Cancel that ****	end	inst:AddTag("mightyable") -- We normal now, not yet there	inst:ListenForEvent("oneat", CheckForMighty) -- We listen for stuff we eat!endlocal function Mightlyzation(inst, fromLFE)	if fromLFE then -- We come from the ListenForEvent check, with the PushEvent with true?		inst:RemoveEventCallback("oneat", CheckForMighty) -- Cancel that ****	end	inst:AddTag("mightybuzz") -- We got mighty status now, can craft recipes with mightybuzz tag	if inst:HasTag("mightyable") then -- Best we get rid of the middleman tag		inst:RemoveTag("mightyable")	end	inst:AddTag("pyromaniac") -- Now I can craft recipes with pyromaniac tag requiredendlocal function OnSave(inst, data)	data.mightycraft = inst:HasTag("mightybuzz") -- We save if we mighty, age is saved anywaysendlocal function OnLoad(inst, data)	if data.mightycraft then -- We mighty? Let's go!		inst:PushEvent("BeMighty", false)	else -- Not mighty		local age = inst.components.age:GetAgeInDays() -- Get my age		if age < N_days then -- We normal?			inst:WatchWorldState("startday", CheckForNormal) -- No? Then let's wait		else			inst:PushEvent("BeNormal", false) -- Yes, let's go!		end	endend	-- in master_postinit	inst:ListenForEvent("BeNormal", Normalization)	inst:ListenForEvent("BeMighty", Mightlyzation)	inst.OnSave = OnSave    inst.OnLoad = OnLoad

you are awsome. i want you to know that :D i will check this out later as im fairly busy today. but thank you sooo much

Link to comment
Share on other sites

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
 Share

×
  • Create New...