Nirvh Posted December 15, 2015 Share Posted December 15, 2015 yo, so i was trying to ad wx ability to charge with lightning (without the rain debuff) to my charater,but i m having some problems and the games crash all the time. does anyone know what part of the code i have to copy? Link to comment Share on other sites More sharing options...
Mobbstar Posted December 15, 2015 Share Posted December 15, 2015 The part from wx78.lua about lightning... What code have you copied? Link to comment Share on other sites More sharing options...
Nirvh Posted December 15, 2015 Author Share Posted December 15, 2015 i kinda try a bit of everything. i m not even a beginner with coding. i copied part of the fileyou mentioned, in particular the part that talkabout spark (that i think it s about the rain so i deleted it). here s the text i copied, if it can help you help me: (first try) local prefabs = { "sparks"} ..... local function onpreload(inst, data)if data thenif data.level theninst.level = data.levelapplyupgrades(inst)--re-set these from the save data, because of load-order clipping issuesif data.health and data.health.health then inst.components.health.currenthealth = data.health.health endif data.hunger and data.hunger.hunger then inst.components.hunger.current = data.hunger.hunger endif data.sanity and data.sanity.current then inst.components.sanity.current = data.sanity.current endinst.components.health:DoDelta(0)inst.components.hunger:DoDelta(0)inst.components.sanity:DoDelta(0)endend end local function onload(inst, data)if data then if data.charge_time theninst.AnimState:SetBloomEffectHandle( "shaders/anim.ksh" ) onupdate(inst, 0)inst.charged_task = inst:DoPeriodicTask(1, onupdate, nil, 1)end endend local function onsave(inst, data)data.level = inst.leveldata.charge_time = inst.charge_timeend local function onlightingstrike(inst)inst.charge_time = inst.charge_time + TUNING.TOTAL_DAY_TIME*(.5 + .5*math.random()) inst.components.health:DoDelta(TUNING.HEALING_SUPERHUGE,false,"lightning")inst.components.sanity:DoDelta(-TUNING.SANITY_LARGE)inst.components.talker:Say(GetString("wx78", "ANNOUNCE_CHARGE")) inst.SoundEmitter:KillSound("overcharge_sound")inst.SoundEmitter:PlaySound("dontstarve/characters/wx78/charged", "overcharge_sound")inst.AnimState:SetBloomEffectHandle( "shaders/anim.ksh" ) if not inst.charged_task thenonupdate(inst, 0)inst.charged_task = inst:DoPeriodicTask(1, onupdate, nil, 1)endend tnx for your time, by the way Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.