• Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About sergiohmcl

  • Rank
    Junior Member
  1. Thank You!! It worked. I will try to hand it from here. Also, I must confess I didn't find "shadowlumber" in prefabs files too and i don't have a clue where they are, but I found in wiki this is the prefab code for maxwell's lumber and when trying c_give( "shadowlumber") in console while in game, it spawned a shadow. It worked tho. Thank You again.
  2. I started with modding recently and I've been reading some stuff in the forum in order to understand how all the things work. I tried, then, create my own mod, which consists (in theory) of moving maxwell's shadows in the direction of the mouse by pressing some key. I found some things in the forum and tried to get all the info together and I did the following. function Func() GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_V, function() pt = TheSim:GetPosition() if GLOBAL.TheInput:IsKeyDown(GLOBAL.KEY_V) then self.inst.components.locomotor:RunInDirection(self.inst:GetAngleToPoint(pt)) self.inst.components.locomotor:RunForward() end end) end AddPrefabPostInit("shadowlumber", Func) That was my base. I got an error saying "attempt to index global variable 'TheInput' (nil value)" or something along these lines. Then I tried to remove that part of the code, it is, deleting all the stuff with IF THEN and the part with 'IsKeyDown'. Then I got a new error saying "attempt to index global variable 'self' (nil value)". I took out all the 'self's in the code and got the same error. I also tried making self as an argument of the function. Finally, I tried to adress the object "shadowlumber" directly (I didn't know if that would work tho), replacing all the "self" by "shadowlumber". By now I don't know what to do. If someone could point me some direction... Note: I'm testing all in offline mode.