UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Level switch function?

HOT
broken avatar :(
Created 13 years ago
by daedra descent
0 Members and 1 Guest are viewing this topic.
8,986 views
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
Signature
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
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!



broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 3 years ago
Posts
5,544
Respect
6,646Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
Signature
If Java had true garbage collection, most programs would delete themselves upon execution.
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator 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.
broken avatar :(
×
broken avatar :(
Relentless Mapper
Location: ar
Date Registered: 21 August 2011
Last active: 17 hours ago
Posts
1,323
Respect
Forum Rank
Zombie Colossus
Primary Group
Nuclear
My Groups
More
Personal Quote
This game isn't meant to be played
×
KDXDARK's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Nuclear
Nuclear
DARKLEGION's requested title
Mapper Has released one or more maps to the UGX-Mods community.
KDXDARK's Contact & Social Links
i know a way but i dont know if it works in coop, im in the phone, but tomorrow i going to tell you how to do it
broken avatar :(
×
broken avatar :(
Location: usThe North Pole
Date Registered: 12 September 2013
Last active: 12 years ago
Posts
123
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
I have come from the future
Signature
NaviLlicious
×
NaviLlusShore's Groups
NaviLlusShore's Contact & Social LinksTheHubbyNaviLlusShore
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?
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
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
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 3 years ago
Posts
5,544
Respect
6,646Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator 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 tried doing the changelevel() function from Mods respitory's GSC thing and got an unknow function, do you know what script that's in?
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.

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
the 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.
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
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
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 3 years ago
Posts
5,544
Respect
6,646Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator 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:
Code Snippet
Plaintext
raw\maps\_endmission.gsc:693: ChangeLevel( "" );
raw\maps\_endmission.gsc:697: ChangeLevel( "nazi_zombie_prototype" );
raw\maps\_load.gsc:2475: ChangeLevel( level.script, false );
raw\maps\_menus.gsc:224: changelevel( map );
raw\maps\intro_pac.gsc:15: ChangeLevel( "mak" );
raw\maps\outro.gsc:17: ChangeLevel( "credits" );
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
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:
Code Snippet
Plaintext
raw\maps\_endmission.gsc:693: ChangeLevel( "" );
raw\maps\_endmission.gsc:697: ChangeLevel( "nazi_zombie_prototype" );
raw\maps\_load.gsc:2475: ChangeLevel( level.script, false );
raw\maps\_menus.gsc:224: changelevel( map );
raw\maps\intro_pac.gsc:15: ChangeLevel( "mak" );
raw\maps\outro.gsc:17: ChangeLevel( "credits" );

I'm still getting unknown function errors for some reason. This is what i have:

Code Snippet
Plaintext
#include common_scripts\utility; 
#include maps\_utility;
#include maps\_zombiemode_utility;

level_switch_tesla()
{
trig = getent("level_switch_Tesla", "targetname");
trig.is_available = 1;
trig.zombie_cost = 0; //doesn't cost anything... for now
trig.in_use = 0;
trig sethintstring(&"SWITCH_LEVEL_TESLA");
trig setCursorHint( "HINT_NOICON" );

while(1)
{
trig waittill( "trigger", who );
{
if( is_player_valid( who ) )
{
if( who.score >= trig.zombie_cost )
{
who maps\_zombiemode_score::minus_to_player_score( who.score );
wait(1)
changelevel( "Tesla" );
}
}
}
}
}
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 3 years ago
Posts
5,544
Respect
6,646Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator 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.
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
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?
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 6 August 2012
Last active: 6 years ago
Posts
277
Respect
Forum Rank
Mr. Elemental
Primary Group
Scripter Elite
My Groups
More
×
YaPh1l's Groups
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
YaPh1l's Contact & Social Links
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
broken avatar :(
×
broken avatar :(
Relentless Mapper
Location: ar
Date Registered: 21 August 2011
Last active: 17 hours ago
Posts
1,323
Respect
Forum Rank
Zombie Colossus
Primary Group
Nuclear
My Groups
More
Personal Quote
This game isn't meant to be played
×
KDXDARK's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Nuclear
Nuclear
DARKLEGION's requested title
Mapper Has released one or more maps to the UGX-Mods community.
KDXDARK's Contact & Social Links
oh sorry i read something wrong, you say levels (i think in rounds) sorry for that
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
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?
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 3 years ago
Posts
5,544
Respect
6,646Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator 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.

 
Loading ...