Jump to content

Gamer4Life

Members
  • Content Count

    52
  • Joined

  • Last visited

Community Reputation

1 Neutral

About Gamer4Life

  • Rank
    Advanced Member
  1. Thanks Rick. That was the issue. It took me a while to figure out the line underneath it after I changed the line to what you recommended but essentially since it would not let me use the script I had to identify each by name. If anyone needs a health pack code that seemed to work for me. Script.health = 25.0 --float "Health" Script.useOnce = true --bool "Use once" function Script:Start() if self.health < 0 then error ("Health can't be a negative value.") end end function Script:Use(player) if player.health < player.maxHealth then player.health = self.health + player.health if self.useOnce then self.entity:Release() end end end
  2. I was trying to get a health pack pick up script working from a leadwerks tutorial video and for some reason I'm getting a script nil value on line 11 at ,( if player.script.health < player.script.maxHealth then. ) Anyone know why? Script.health = 25.0 --float "Health" Script.useOnce = true --bool "Use once" function Script:Start() if self.health < 0 then error ("Health can't be a negative value.") end end function Script:Use(player) if player.script.health < player.script.maxHealth then player.script:ReceiveHealth(self.health) if self.useOnce then self.entity:Release() end end end
  3. Is there another way to parent objects besides dragging and dropping them? For example, is there a hotkey like ctrl+c or something that allows me to grab a block at the bottom of my scene list and then paste it to a parent at the top of my scene list ,or do i have to hold left click and scroll all the way to the top of the list?
  4. The cause to this was that the wrong start file loaded so i deleted all the extra ones i had and changed the one I wanted to the default start map name.
  5. Yup, Thanks a bunch for all the replies but after a while of tinkering with the logic and reviewing some similar toggles I found a way to get it to work. This works like a champ if anyone wants to use a toggle trigger to turn a spawner on. Script.Target = nil --Entity "character target" Script.SpawnRate = 5.5 --float "spawn rate" Script.MaxZombies = 5 --int Max zombs function Script:Start() self.enabled = false end function Script:Use() self:Toggle() end function Script:Toggle()--in if self.disabled then self.enabled = true self.lastSpawnTime = 0 self.counter = 0 else self.disabled = true end end function Script:UpdatePhysics() if self.enabled then if self.counter >= self.MaxZombies then return end if Time:GetCurrent() > self.lastSpawnTime + (self.SpawnRate * 1000) then self.counter = self.counter + 1 self.lastSpawnTime = Time:GetCurrent() --create a zombie and set location, speed, and target to the player local zombie = Prefab:Load("AddOns/Zombie Character Pack/zombie1.pfb") zombie.script:Start() zombie:SetPosition(self.entity:GetPosition()) zombie.script:Enable() --zombie.script.Speed = 2 zombie.script.Player = self.Target end end end
  6. No it is a completely different steam account and I have this account linked as a friend. The game is set to friends-only and neither this computer or that one can load that game after it is downloaded. I subscribe and download the game and when i click the download to play it brings up the launcher then nothing happens and the game is not listed in the launcher.
  7. From what I have read once you have published the game to steam and you have friends-only selected they can view and download your game right away and can play it. I have published the game and updated it and it shows in my workshop and after I subscribed to it on this account/computer and my other computer/account i think select launch the game with leadwerks launcher, but when I do that it only opens up the launcher and shows me the list of games and my game is not visible to select. Is there a reason why this is happening by chance?
  8. Already attempted it multiple times, it did not fix it sadly. I am not sure what else i could do lol. Something in between the game running in the engine and being published is messing up.
  9. Correct, all the files seem to be loaded and in their proper location as in the game prepublished. I also did not see an option to manually move the files on publishing i only saw and option to move all files and to move only the files used.
  10. Okay cool that worked great. The Error that is being registered is 302 attempt to call local 'luaFile' (a nil value) when it is opening scripts/items/note.lua. I'm not sure why it is getting that error when it works fine in the none published version. it crashes as soon as i click E on the note to open it
  11. The game does not crash in debug mode. Everything runs fine when run the game in leadwerks but after i publish the game as standalone the game crashes when I open the notes.
  12. I am currently crashing anytime I open my published games .exe file when I click on a Amnesia note. I have sandbox lua unselected like it was recommended and everything is attached properly. The notes work fine before i publish the game but after the game is published, opening the notes causes the game to crash. It flashes to fast for me to read what error is being produced. Has anyone heard this from anyone else or have any idea why this is crashing?
  13. I attempted to publish a game to by selecting file/publish/stand and downloaded/compressed the file into a folder. For some reason when I run the .exe file it only shows 1% roughly of the stuff that is in the game. The game launches and has a small part but almost nothing in it. Is there something I did wrong?
  14. I honestly wouldn't even know how to check during the debug running of the program if that value was getting swapped. I don't see an option to view outputs/inputs being produced in debug.
  15. Oddly enough that is what I had the first time but when click the button to activate the spawner it does nothing. I am trying to incorporate a toggle function into it so the button use toggle output will work with the spawner but so far no effect. There are no run time errors produced so i'm trying to find the fail. Any thoughts? Script.Target = nil --Entity "character target" Script.SpawnRate = 5.5 --float "spawn rate" Script.MaxZombies = 5 --int Max zombs function Script:Start() self.enabled = false end function Script:Use() self:Toggle() end function Script:Toggle()--in if self.enabled == true then self.enabled = true self.lastSpawnTime = 0 self.counter = 0 else self.enabled = false end end function Script:UpdatePhysics() if self.enabled then if self.counter >= self.MaxZombies then return end if Time:GetCurrent() > self.lastSpawnTime + (self.SpawnRate * 1000) then self.counter = self.counter + 1 self.lastSpawnTime = Time:GetCurrent() --create a zombie and set location, speed, and target to the player local zombie = Prefab:Load("AddOns/Zombie Character Pack/zombie1.pfb") zombie.script:Start() zombie:SetPosition(self.entity:GetPosition()) zombie.script:Enable() --zombie.script.Speed = 2 zombie.script.Player = self.Target end end end
×
×
  • Create New...