Jump to content

klanphear

Members
  • Posts

    25
  • Joined

  • Last visited

Everything posted by klanphear

  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. 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.
  3. 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.
  4. 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)
  5. 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.
  6. 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.
  7. work's great but I get a warning. Lua sandboxing disabled. Does anyone else? is this normal?
  8. a pivot button under the directional light on the left toolbar would be nice.
  9. so would it be? fruit = "apple" --choiceedit "fruit" "apple, banana, ..." love Leadwerks by the way. Hours of fun.
  10. 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.
  11. Can anyone tell me the difference between choice and choiceedit? thanks
  12. 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
  13. 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 ------------------------------------------------------------------
  14. 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 ------------------------------------------------
  15. Thanx, I just spent the last 2 hrs trying to get the ammo to draw to the window without overwriting itself. This has the added clip info also. Nice!!!!! Now I just need to learn how to draw different fonts on same screen without every Font syle and size being changed.
  16. If I use the TriggerChangeMap script without any weapon equipped it works fine. When I pick up a weapon from the dlc FPSWeapon pack or start with autopistol prefab I get an error " Lua error: stack overflow " when trigger is activated. I also noticed an error with the dlc melee weapon equipped and trigger map change I get an error "attempt to index a nil value Line 268. " I corrected it by changing the second self.emitter release number from [1] to a [2] in the function script:Release() section of the FPSMeleeWeapon script. Thank you for all help in advance, Kirk
  17. Thanks so much, the window was actually on the right hand side and i was trying the top and bottom. Thank's again. Peace out Capt. K
  18. How do you get the output, warnings, errors, debug screen to appear in the script editor window? I have looked all through the menus and options. I am currently running steam indie version on PC Win 8.1 I had the window at some point when I first purchased in the beginning of the year. I don't recall closing a window and can't seem to be able to pull open any window from the edges of the of the script editor box as if i resized it shut. Jorn Theunissen's utube video Lua #9:Damaging the player shows the raycast output in the script editor at 8 min 40 secs shows at the top of the screen. I only have the script writing section. I am thinking of purchaseing Leadwerks Standard Edition Steam. Am I getting the same software as buying it from Leadwerks direct? Thank you in advance Capt. Kirk
  19. Any help is appreciated. I am not against spending money, I am against throwing money in the toilet and hitting the " flush collision trigger " by accident.
  20. Navmesh by hand would be cool or at least the ability to modify the boundries of the mesh. That would allow you to actually run away or hide behind certain game objects. You probably can do it with code but I am but a newb. If it is possible please let me know.
×
×
  • Create New...