Jump to content

Recommended Posts

Posted

Hey guys,

 

So Piller helped me making a script to load a new map when entering an object in game, with collision type ''trigger''. In App.lua you can see some changes in the App.lua script, and if you go to assets > scripts > objects > triggers > LoadLevel.lua you see the second part in order to load new maps. Now as far as I know I have done exactly what Piller's video described to me what I should do but I get this error when entering the trigger object:

 

Program:

...ents\Leadwerks\Projects\buildandshoot\buildandshoot.debug.exe

File: c:\program files (x86)\microsoft visual studio

12.0\vc\include\vector

Line: 1442

 

Expression: vector erase iterator outside range

For information on how your program can cause an assertion failure, see the Visual C++ documentation on asserts.

 

(Press Retry to debug the application)

 

Here is Piller's video:

http://www.youtube.com/watch?v=FBFNbZxoAC8

 

Is there anything wrong in my part of the scripts, or is there something wrong with my pc settings?

 

The project file can be downloaded here too. If you load the project on start.map you will see a wooden block in front of the place where you spaw: this is the trigger to go to lol.map. In lol.map there is also a wooden block functioning as trigger. You can change to which map the object refers, by selecting the object, going to scene and then object scripts, and there you should be able to change it.

 

Hopefully you guys can solve my issues!

Posted

Looking at your code from steam. Inside ShouldSwitchLevel() you have Map.Load() instead of Map:Load(). It's different because Map: passes a variable as the first parameter behind the scenes for you, while Map. does not, when calling functions.

Posted

Sorry, I updated my last post with what is probably wrong. I looked at your code on Steam.

 

Sorry, I updated my last post with what is probably wrong. I looked at your code on Steam.

 

Changed it to Map:Load(self.mapFile) and I still get the same error :S

LoadLevel.lua

App.lua

Posted

So you attached LoadLevel.lua to a csg that is of type Trigger? Then you filled out the Map parameter with a valid path/file to a map? What value did you give the Map parameter of the csg trigger you have LoadLevel.lua attached to

Posted

Everything what I have in those .lua files are exactly what I use in game. I attatch LoadLevel to an object which is set as trigger at collision type. Then at the script tab at Map I have got lol.map selected.

Posted

And that map exists in your maps folder for the current project you are in? Can you load that map in the editor and it doesn't give and error itself?

 

lol.map exists in C:\Users\********\Documents\Leadwerks\Projects\buildandshoot\Maps

so it is in the right folder yes. In the editor itself it does not give an error, no. I can also launch both maps perfectly fine, but as soon as I step into the trigger on start.map it gives the error. When I step into the trigger on lol.map my screen starts shaking and it gives a diffrent error: failed to read file ''C:\Users\********\Documents\Leadwerks\Projects\buildandshoot''

Posted

This is a tough one. I just took the 2 scripts you posted and made a test scene and it worked just fine. If your map has just the default stuff (models/textures that come with LE) then can you attach both maps and I can test it.

Posted

with 2 new clean maps (i imported all the scripts from other project though) it just gives this error:

failed to read file ''C:\Users\********\Documents\Leadwerks\Projects\buildandshoot'' so it doesn't work on that either :/

 

I do use the assets > models > characters > generic.mdl as first person controller. Next to that I have also implemented your teleportation script.

 

the teleport blocks are at physics > collision type = trigger so that should be allright as well.

 

I'm gonna take a nap now, I've been awake way too long today already ;)

 

I'll check the forums and all when I wake up again.

Thanks for your help!

Posted

ok. Btw, I do use leadwerks in Beta stage ( so i get all the updates early). I added maps to this message. Those are the ones without files from outside leadwerks (2 basic testmaps). (change .lua to .map, i can't upload .map since im not permitted)

 

the other (primairy) maps, on which I at first created the scripts were too big to upload here.

 

but I'm gonna sleep now, see you in perhaps about 8 hours. And once again, thx for your help :)

lol.lua

start.lua

Posted

Those work for me so not really sure what the deal could be. Take the entire project folder and zip it up and make a post in the Bugs forum and attach it for Josh to see what's up.

Posted

Okay, i'll do that. But if we go back to the very first error I've had, what does that mean in general? Can it be that there is something wrong with my computer settings?

Posted

Those work for me so not really sure what the deal could be. Take the entire project folder and zip it up and make a post in the Bugs forum and attach it for Josh to see what's up.

 

one small problem though: the project is 500mb. I can upload a maximum of 0.5 kb to those forums.

  • 4 weeks later...

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.

×
×
  • Create New...