klanphear Posted December 27, 2014 Share Posted December 27, 2014 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 Quote Link to comment Share on other sites More sharing options...
klanphear Posted January 25, 2015 Author Share Posted January 25, 2015 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 ------------------------------------------------ Quote Link to comment Share on other sites More sharing options...
klanphear Posted January 25, 2015 Author Share Posted January 25, 2015 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 ------------------------------------------------------------------ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.