Jump to content

Gamer4Life

Members
  • Posts

    52
  • Joined

  • Last visited

Posts posted by Gamer4Life

  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. 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
    

  5. 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.

  6. 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?

  7. 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.

  8. 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

  9. 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?

  10. 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?

  11. 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

  12. I found a tutorial for a decent script to make a monster spawner ,but I do not need it to run upon game start as it was shown in the tutorial. I'm pretty bad at scripting but i tried to have the spawner disabled at start and tried to start it upon enabling but I am jacking something up in the code somewhere and I lack the experience to find out where. If you can help me correct my mistake I would be thankful:)

     

    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:Enable()--in

    if self.enabled == false then

    self.enable = true

    self.lastSpawnTime = 0

    self.counter = 0

    end

    end

     

    function Script:UpdatePhysics()

    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

  13. Has anyone else had issues with the Oak in the nature model pack not having the collision lined up properly? The collision is there but it is off to the side of the tree model. I spawned some pines and they seemed to work fine but the oaks i spawned all had the collision object off to the side of the tree and you could walk through the tree.

  14. How will raiseland DLC work with the new 4.0 update exactly. I am considering purchasing this software. Is the DLC incorporated into the leadwerks engine or is it a separate generator that you have to transfer the generated maps into leadwerks. Also, will the new vegetation generation/textures from the 4.0 update be able to add additional detail to the generated environment that is created by raiseland? If anyone knows anything about this please respond. Thanks and Happy holidays.

  15. Heya, everyone. I was wondering if someone can help me fix this problem i'm having. I am trying to create a turret that targets someone when they come in range of it and shoots them. I got all that working fine, but this turret can shoot through walls. I was wondering if someone had any idea what I need to change on the walls, or the code to enable a Line of Sight factor. This is the script atm i'm using.

     

    Script.aimingLocation = "" --entity "Aiming Location"

    Script.rotSpeed = .1 --float "Rotation Speed"

    Script.fireRate = .1 --float "Fire rate"

    Script.fireRateTimer = 0

    Script.muzzleFlashLight = "" --entity "Muzzle flash light"

    Script.muzzleTime = 0.1 --float "MuzzleTimer"

    Script.muzzleTimer = 0

    Script.gunFireSoundPath = "" --path "Fire Sound" Wav file (*wav):wav|Sound"

    Script.gunFireSoundFile = nil

    Script.fireRange = 15 --float "Fire range"

    Script.damage = 5 --float "Damage per bullet"

     

     

    function Script:Start()

    self.muzzleFlashLight:Hide()

    if self.gunFireSoundPath ~= "" then

    self.gunFireSoundFile = Sound:Load(self.gunFireSoundPath)

    end

    end

     

    function Script:UpdateWorld()

    --fire rate

    self.fireRateTimer = self.fireRateTimer + (Time:GetSpeed()/100)

    self.muzzleTimer = self.muzzleTimer + (Time:GetSpeed()/100)

    --get positions

    local turretPos = self.entity:GetPosition()

    local playerPos = self.aimingLocation:GetPosition(true)

     

    --is target in range?

    if(turretPos:DistanceToPoint(playerPos) <= self.fireRange) then

    --rotate turret toward target

    self.entity:Point(self.aimingLocation, 2, Time:GetSpeed() * self.rotSpeed)

    --allow firing

    if(self.fireRateTimer > self.fireRate) then

    local pickInfo = PickInfo()

    local point2 = Transform:Point(0,0,self.fireRange, self.entity, nil)

     

    if (self.entity.world:Pick(turretPos, point2 ,pickInfo, 0, true, Collision.Prop)) then

    self.aimingLocation:GetParent().script:Hurt(self.damage)

    end

     

    self.muzzleFlashLight:Show()

    self.muzzleTimer = 0

    self.fireRateTimer = 0

    self.gunFireSoundFile:Play()

    end

    end

     

    if(self.muzzleTimer > self.muzzleTime) then

    self.muzzleFlashLight:Hide()

    self.muzzleTimer = 0

    end

    end

  16. I Published the game I created to my desktop and it runs fine on the desktop but when I send the .exe file to another person or send it to myself and try and run the .exe file i get a Steam_api.dll error. Does anyone know what is causing this and how to either go around it or correct the error?

  17. Is it possible to move a Pivot using the door button script by attaching the sliding door script to the pivot?

    For some reason it is not working and I am farely new to this, but the scripts works with just about every object i try except this Pivot that i have multiple blocks parented to. So what i'm trying to do is parent blocks to the pivot then have the scripts move the pivot so all the blocks move at once, but the script is not working and i know the button works because i used it with another object with the door script parents to it just to check.

  18. I'm relatively new to blender but trying to self teach myself blender and leadwerks at same time and it can be frustrating. I am trying to import a picture/.jpg into blender then transfer it as a texture or model into Leadwerks. I have the picture in blender on a plane and have it in the UV/editor, with face textures applied and the scene camera can pick up the image, however when I go to export it only lets me export it as a model and when it does it exports the blank plane and blank grid mat. Not sure what i'm doing wrong. Any recommendation what i might be doing wrong?

×
×
  • Create New...