Jump to content

Change map doesn't work with FPSWeapon dlc Steam (Lua)


klanphear
 Share

Recommended Posts

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

Link to comment
Share on other sites

  • 4 weeks later...

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

------------------------------------------------

Link to comment
Share on other sites

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

------------------------------------------------------------------

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...