ninidelos

  • Content Count

    8
  • Joined

  • Last visited

Community Reputation

0 Neutral

About ninidelos

  • Rank
    Junior Member
...
  1. I don't think that will work, you basically just changed the order of what I wrote. mine is like an yours is I believe the problem is linked to the following part inst.components.weapon:SetOnAttack(onattack_red) -- has the attack swing animation --and inst.components.weapon:SetProjectile("fire_projectile") -- has the projectile animation So in order to fix the issue I might have to create/change the weapon component
  2. oh, just an observation, when making the art, be aware that the template's character head is not only smaller than the average character's but also lower, so remember to check and adjust it to what you want to make. [edit] Made these images as a guide for myself and don't see a reason not to share
  3. okay, so I learned a few things while tweaking the staff and solved this problem with the following: local function onattack_red(inst, attacker, target, skipsanity) local owner = inst.components.inventoryitem.owner local brainjuice = owner.components.sanity.current if brainjuice >= 30 then if not skipsanity and attacker ~= nil and attacker.components.sanity ~= nil then attacker.components.sanity:DoDelta(-TUNING.SANITY_HUGE) inst.components.fueled:DoDelta(-TUNING.NIGHTSTICK_FUEL*0.1) end -- chunk I'm not adding here -- else inst.components.talker:Say("I'm out of brain juice...", 1,true) end end now I just need to learn how to stop the fireball animation from triggering when the attack fails
  4. I think you have to add it to your copy of the nighmarefuel.lua (or whatever you named it) since it's the item you want to make edible
  5. it says: attempt to index local 'owner' (a nil value) Hum... I'll keep trying and searching a solution. For now I'll leave a cleaned up version of the script for anyone who wants to check it out. I removed some stuff from the staff.lua that I was sure weren't necessary. wand.lua
  6. when I do that it says "attempt to compare table with number" I had another idea but it's not workin either. I tried writing a function to check the amount of sanity called "brainjuice" (it might be completly wrong since I made it up looking at other codes) this function is supposed to be called by "inst.components.weapon:SetOnAttack(brainjuice)" and should run the function "onattack_red" when sanity > 49. local function brainjuice(owner) if owner.components.sanity >= 50 then return onattack_red else inst.components.talker:Say("I'm out of brain juice", 0.1,true) end end but, as I said, that is not working. it says "attempt to compare number with nil". tried with "attacker" instead and got the same result.
  7. @AkaiNight thanks for the ideas. I couldn't make it work though. So for both changes I got "variable 'owner' is not declared" tried adding the following in 'local function commonfn(colour, tags, hasskin)' but the error was still the same local owner = inst.components.inventoryitem:GetGrandOwner() then I added 'owner' to the line local function onattack_red(inst, attacker, target, skipsanity, owner) and got "attempt to index local 'owner' (a nil value)" (as I said, when it comes to coding, I don't really know what I'm doing (^-^;) ) I thought of making adding an if/else statement inside onattack_red without changing what was already given by the game but couldn't get it to work. Still havin issues with an undeclared variable 'owner'. So the problem now seems to be that I don't know how to declare nor where to put the variable "owner".
  8. Hi o/ First of all, sorry for my bad english. Haven't practiced much lately. So... I started making a character a couple days ago and wanted to give her an unbreakeable firestaff that sucked a lot of sanity each use (a not so good emergency light). The problem I'm having is that she can still cast fireballs even when her sanity ends. There's a piece of code in the firestaff that reduces sanity but nothing to check whether the character has enough to spend. I don't know how to code, tried adding many different forms of if/else sanity checks, and nothing worked. I don't really remember what the game crash logs told me were wrong and didn't take screenshots but I guess sometimes it was because I tried comparing a table to a number or assigned nil to some variable. I might have misplaced something too. I've got the feeling that this is something easy to solve if you know what you're doing, but that's not my case. So I need help figuring out how to make the staff unusable when sanity <50. I'm adding the script just in case. I think I have to add something in the onattack_red function but don't know what nor where. wrenstaff.lua