Jump to content

klanphear

Members
  • Content Count

    25
  • Joined

  • Last visited

Community Reputation

19 Good

About klanphear

  • Rank
    Member

Profile Information

  • Gender
    Male
  • Location
    Rhode Island

Recent Profile Visitors

1,722 profile views
  1. Hello, I am trying to check the world for a prefab entity. I can retrieve the names for model entities but not the prefabs. If I change the name of the prefab(returning it to a model) it will get said value. I am trying to write a script in Lua to check if the "FPSPLayer" is present in the world, if the player is not present then create a camera. If I check for a model entity and it is present the camera is not created, if not present it creates the camera, so I know my script works just not for any prefab item. I have tried several prefabs with no avail. Models return "name" just fine. I found a function posted by Rick and modded it to use on a pivot with a key-press, thanks for all your posts have learned a lot. ty to all others who help in the forum also. function Script:Start() end function Script:UpdateWorld() if window:KeyHit(Key.I) then self:FindEntity() end end function Script:FindEntity(entityName) local x local world = World:GetCurrent() for x = 0, world:CountEntities() - 1 do local entity = world:GetEntity(x) System:Print("name = "..entity:GetKeyValue("name")) if entity:GetKeyValue("name") == entityName then return entity end end return nil end if I run this the output is listed below. I have the player prefab and controller prefab in the scene. I noticed CSG objects do not appear also with the exception of the Arch 1 which I did not rename. Loading shader "C:/Users/klanp_000/Documents/Leadwerks/Projects/test/Shaders/Model/Shadow/shadow.shader"... Loading shader "C:/Users/klanp_000/Documents/Leadwerks/Projects/test/Shaders/Lighting/directionallight.shader"... name = name = name = name = name = name = name = name = name = name = name = controller name = name = name = generic name = firepit name = brick name = Pivot 2 name = Arch 1 name = track_loader name = Directional Light Process Complete. any help appreciated, ty kirk
  2. Loving Leadwerks, So Smooth

  3. You can also make it invisible on start like the fpsplayer script, line 187. That way you can see it in the editor but not in the game.
  4. Increasing your move speed still can effect this though. so 0.5 works with a 2.5 move speed so you may have to adjust this if you require higher speeds. Just implementing a check like they said above is the better choice but for someone with little coding knowledge this is a quick work around.
  5. just checked an old script and didn't shoot myself. Further investigation shows hitbox for bullets at line 177, FPSPlayer script. if I translate the zed axis value negitive (-1) I can't seem to be able to shoot myself and the merc can still kill me. I usually do not change the original scripts that come Leadwerks I make a copy so I have reference if I mess up. I changed this line at 181 hitbox:Translate(0,0.9,-1) --Hitbox for bullets self.entity:SetCollisionType(Collision.Character) local hitbox = Model:Box(0.5,1.8,0.5) hitbox:SetPosition(self.entity:GetPosition()) hitbox:Translate(0,0.9,-1) hitbox:SetParent(self.entity,true) hitbox:SetCollisionType(Collision.Prop) hitbox:SetShadowMode(0)
  6. Angelwolf, Just tried re- moving light and I still shoot myself. I have child pivots for HUD and game info. I will try moving and removing those next. It seems to occur mostly on first firing gun. Had dropped the vwep prefab into the scene in the past and it seemed to help, but I can still shoot myself. Maybe this will be my focus today.
  7. I have the same issue and have for some time. Just haven't got around to trying to figure it out. I am using the FPS Pack from the store. It seems to have started around the time the Merc came out. The Shot Gun hurt's a lot. I have actually used it to kill me testing re-spawn code. I was my own enemy. Maybe the hitbox is intersecting with the bullet. Possible that the pick point is too close to player hitbox, rotation or speed related? Haven't had time to try to figure it out, this never used to happen to me. I thought maybe it was just some bug I created but it happens with clean install, new project and very randomly. BTW loving leadwerks, runs like butter on my machine. So quiet. People who purchased the weapon pack and die by their own weapon may not be to happy. I will keep an eye on the post's. I know the say's solved but, re-coding the dlc weapons you just bought to use them would have to suck. Especially if you are just getting started and you just bought them. Just sayin.
  8. work's great but I get a warning. Lua sandboxing disabled. Does anyone else? is this normal?
  9. a pivot button under the directional light on the left toolbar would be nice.
  10. so would it be? fruit = "apple" --choiceedit "fruit" "apple, banana, ..." love Leadwerks by the way. Hours of fun.
  11. Are there any examples or documentation available? I know how to use choice just not clear on how to use choiceedit. Does it allow user to change choice label values? Does it change the 0,1,2.... to what ever you want to use eg.. 0 would be apples, 1 oranges? Are there any used in flogui scripts? I have the download. thanks Also nice work on the flogui scripts AggorJorn.
  12. Can anyone tell me the difference between choice and choiceedit? thanks
  13. Just would like to thank you for the tutorials you have provided. I have been a gamer since the early 80's and love being able to create my own 3D world. Your tutorials are making that possible. Thank you and have a great day. klanphear
  14. just realized I didn't put a check for a map name. Here is the corrected script. ------------------------------------------------------------- Script.mapname=""--string "Map Name" function Script:Collision(entity, position, normal, speed) local nameEnt = entity:GetKeyValue("name", "") if nameEnt == "Player" then function ReleaseTableObjects() end if self.mapname ~= "" then changemapname=self.mapname end end end ------------------------------------------------------------------
  15. I have modified the TriggerChangeMap.lua to release the players table objects and map switching works. The data doesn't get saved but I can still switch maps with a weapon attached and I no longer get the " Lua error: stack overflow " when trigger is activated. My next adventure will be to try and tame GetEntityNeighbors.lua and pass some info to the next map. Here is the script I used. Hope this can help someone. I am new to scripting so if there is something I am missing please let me know. ------------------------------------------------------- Script.mapname=""--string "Map Name" function Script:Collision(entity, position, normal, speed) local nameEnt = entity:GetKeyValue("name", "") if nameEnt == "Player" then function ReleaseTableObjects() end changemapname=self.mapname end end ------------------------------------------------
×
×
  • Create New...