Does anyone know of a script function that switch's the level (while actually in a map) and keeping things like weapons/perks/points? Any ideas would be appreciate!
Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
There's no scripts for that floating around that I'm aware of, and Treyarch didn't need to do that in their code, but all you'd need to do is:
Run a function on all clients that saves their points, stats, and any other relevant information to unused slots in their stats using setStat()
Load the new map from script using ChangeLevel()
Run a function on all clients after the loaded level which loads back their points, stats, etc from the stats file using getStats().
You may be able to use setClientDvar instead of setStat if client dvars aren't lost after a level change - I've never tested it to see.
I planned to use this method to make a level which loaded into different areas similarly to the original Dead Rising game on Xbox 360 but I never got around to it obviously.
do you mean like jumping into a new map while keeping your perks and guns? you could put the second map in your map and move it out of sight and place a 1 way teleporter to that map?
There's no scripts for that floating around that I'm aware of, and Treyarch didn't need to do that in their code, but all you'd need to do is:
Run a function on all clients that saves their points, stats, and any other relevant information to unused slots in their stats using setStat()
Load the new map from script using ChangeLevel()
Run a function on all clients after the loaded level which loads back their points, stats, etc from the stats file using getStats().
You may be able to use setClientDvar instead of setStat if client dvars aren't lost after a level change - I've never tested it to see.
I planned to use this method to make a level which loaded into different areas similarly to the original Dead Rising game on Xbox 360 but I never got around to it obviously.
I tried doing the changelevel() function from Mods respitory's GSC thing and got an unknow function, do you know what script that's in?
also, using this method, could i *potentially* work around sound,fx, and other limits? (kind of the point of doing this) Post Merge: November 04, 2013, 05:12:35 am
do you mean like jumping into a new map while keeping your perks and guns? you could put the second map in your map and move it out of sight and place a 1 way teleporter to that map?
the idea of this is to walk around the engine's limits, not having a map inside a map.
Last Edit: November 04, 2013, 05:12:35 am by daedra descent
Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
also, using this method, could i *potentially* work around sound,fx, and other limits? (kind of the point of doing this) Post Merge: November 04, 2013, 05:12:35 amthe idea of this is to walk around the engine's limits, not having a map inside a map.
No, engine limits like fx and sound are for every map in a mod folder as a whole. This was the main reason I looked into this a while ago, I was wondering the same thing.
You either mistyped it, tried to thread it, or you tried to call it on an entity. It's an engine function, its not defined in script. No, engine limits like fx and sound are for every map in a mod folder as a whole. This was the main reason I looked into this a while ago, I was wondering the same thing.
I used what the tutorial/guide/whatever you call it, which was soemthing like:
Code Snippet
Plaintext
changelevel( "test", true );
the "true" is supposedly what i needed to make sure sure the weapons where persistent through a level.
As for the limits, what about geo related things like brushs and models and such, or are they combined aswell? if not, I won't have an issue since I don't use a lot of fx or sound.
Last Edit: November 04, 2013, 05:24:58 am by daedra descent
Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
I used what the tutorial/guide/whatever you call it, which was soemthing like:
Code Snippet
Plaintext
changelevel( "test", true );
the "true" is supposedly what i needed to make sure sure the weapons where persistent through a level.
As for the limits, what about geo related things like brushs and models and such, or are they combined aswell? if not, I won't have an issue since I don't use a lot of fx or sound.
Those limits would be bypassed, yes. Which is why I mentioned using it for a Dead Rising style setup where large areas are loaded when entering a door or something As far as your code, I don't know if the true/false bool will actually do what it's supposed to because it's meant for campaign levels, but you are calling it correctly in your code snippet so I would make sure you are doing the same thing in your code.
It's definitely a working function (or at least a defined one) because it's present in the production-code of the game and does not cause errors:
Those limits would be bypassed, yes. Which is why I mentioned using it for a Dead Rising style setup where large areas are loaded when entering a door or something As far as your code, I don't know if the true/false bool will actually do what it's supposed to because it's meant for campaign levels, but you are calling it correctly in your code snippet so I would make sure you are doing the same thing in your code.
It's definitely a working function (or at least a defined one) because it's present in the production-code of the game and does not cause errors:
Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
You have no semicolon at the end of the line above.
loads good now, though i still need to add the trigger. Now i'm worried about the other more complicated things like keeping score values and such... is there something out there i can use as a guideline of sorts?
I don't want to be pessimistic, but I have had basically the same idea and already tried it. And it seems that ChangeLevel() doesn't work correctly in Coop.
- Phil.
Last Edit: November 04, 2013, 09:34:17 am by YaPh1l
I don't want to be pessimistic, but I have had basically the same idea and already tried it. And it seems that ChangeLevel() doesn't work correctly in Coop.
- Phil.
Could you be a bit more specific on what does/doesn't work?
anyway, i'm having issues with the trigger, it's giving me the hand icon even though i have everything called correctly... any ideas?
Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
Could you be a bit more specific on what does/doesn't work?
anyway, i'm having issues with the trigger, it's giving me the hand icon even though i have everything called correctly... any ideas?
There's only 3 options for that...
1) You didn't make the ent correctly in radiant/didnt give it the correct targetname 2) You didn't specify the correct targetname in your script 3) You forgot to call your level_switch_tesla() function from somewhere.