Map restart
Moderator: Core Staff
-
- CJ Newbie
- Posts: 51
- Joined: July 2nd, 2012, 11:15 am
Map restart
Hey guys,
i was making a plugin for promod (as it had a .gsc file to add custom functions, like codjumper). I added a toggle fullbright script and it works great!
My problem is that this only works when the server does /fast_restart. It does not load up the function when i try /map_restart or when it actually rotates the map automatically.
Any suggestions/fixes?
Thanks,
darkpheonixz4x
i was making a plugin for promod (as it had a .gsc file to add custom functions, like codjumper). I added a toggle fullbright script and it works great!
My problem is that this only works when the server does /fast_restart. It does not load up the function when i try /map_restart or when it actually rotates the map automatically.
Any suggestions/fixes?
Thanks,
darkpheonixz4x
-
- CJ G0D!
- Posts: 1575
- Joined: June 3rd, 2009, 9:02 pm
- Location: Cardiff University, UK
Re: Map restart
Sounds like you're calling the function too late in the script, which would explain why it works on fast_restart when the map stays the same. Can't really offer any more help without knowing where your script is and such.
-
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Map restart
Start by posting the script, maybe?

Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
-
- CJ Newbie
- Posts: 51
- Joined: July 2nd, 2012, 11:15 am
Re: Map restart
This part is in the _rank.gsc. onJoinedTeam, onJoinedSpectators and onPlayerSpawned is threaded by onPlayerConnect().
and the fullbright toggle script:
Code: Select all
onJoinedTeam()
{
self endon("disconnect");
for(;;)
while(1)
{
self waittill("joined_team");
self thread removeRankHUD();
self iPrintlnBold("^2Press your ^1FRAG ^2and ^1USE ^2key TOGETHER to toggle ^7fullbright");
}
}
onJoinedSpectators()
{
self endon("disconnect");
for(;;)
{
self waittill("joined_spectators");
self thread removeRankHUD();
}
}
onPlayerSpawned()
{
self endon("disconnect");
for(;;)
while(1)
{
self waittill("spawned_player");
self thread fullbrighttoggle();
if(!isdefined(self.hud_rankscroreupdate))
{
self.hud_rankscroreupdate = newClientHudElem(self);
self.hud_rankscroreupdate.horzAlign = "center";
self.hud_rankscroreupdate.vertAlign = "middle";
self.hud_rankscroreupdate.alignX = "center";
self.hud_rankscroreupdate.alignY = "middle";
self.hud_rankscroreupdate.x = 0;
self.hud_rankscroreupdate.y = -60;
self.hud_rankscroreupdate.font = "default";
self.hud_rankscroreupdate.fontscale = 2.0;
self.hud_rankscroreupdate.archived = false;
self.hud_rankscroreupdate.color = (0.5,0.5,0.5);
self.hud_rankscroreupdate maps\mp\gametypes\_hud::fontPulseInit();
}
}
}
Code: Select all
FullbrightToggle()
{
self endon( "disconnect" );
fullbright = false;
while( 1 ) {
wait( 0.05 );
if( self usebuttonpressed() && self fragbuttonpressed() )
{
if( fullbright )
fullbright = false;
else
fullbright = true;
setFullbright( fullbright );
while( self usebuttonpressed() && self fragbuttonpressed() )
wait( 0.05 );
}
}
}
setFullbright( toggle ) {
if( toggle )
self setClientDvar( "r_fullbright", 1 );
else
self setClientDvar( "r_fullbright", 0 );
}
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Map restart
You said there was a gsc file to add your own commands, is that file 'rank' or is there another file?
There are no problems with the code from what I can see, and if there are no other files in the tree, then there is opssibly a load order in the core of promod that does this.
edit:
Noticed this in script, blank loop. (line 5 and line 32)
Not sure what it is doing there, but it certainly isn't helping.
There are no problems with the code from what I can see, and if there are no other files in the tree, then there is opssibly a load order in the core of promod that does this.
edit:
Noticed this in script, blank loop. (line 5 and line 32)
Code: Select all
 for(;;)

Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
-
- CJ Newbie
- Posts: 51
- Joined: July 2nd, 2012, 11:15 am
Re: Map restart
Yes its the _rank.gsc
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Map restart
did you try deleting the pointless "for loops".

Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
-
- CJ Newbie
- Posts: 51
- Joined: July 2nd, 2012, 11:15 am
Re: Map restart
Yep, here's the updated script.
I'm thinking that the problem is because its the _rank.gsc. Do you think threading my function in another gsc like _globallogic would work?
Code: Select all
onJoinedTeam()
{
self endon("disconnect");
while(1)
{
self waittill("joined_team");
self thread removeRankHUD();
self iPrintlnBold("^2Press your ^1FRAG ^2and ^1USE ^2key TOGETHER to toggle ^7fullbright");
}
}
onJoinedSpectators()
{
self endon("disconnect");
for(;;)
{
self waittill("joined_spectators");
self thread removeRankHUD();
}
}
onPlayerSpawned()
{
self endon("disconnect");
while(1)
{
self waittill("spawned_player");
self thread fullbrighttoggle();
if(!isdefined(self.hud_rankscroreupdate))
{
self.hud_rankscroreupdate = newClientHudElem(self);
self.hud_rankscroreupdate.horzAlign = "center";
self.hud_rankscroreupdate.vertAlign = "middle";
self.hud_rankscroreupdate.alignX = "center";
self.hud_rankscroreupdate.alignY = "middle";
self.hud_rankscroreupdate.x = 0;
self.hud_rankscroreupdate.y = -60;
self.hud_rankscroreupdate.font = "default";
self.hud_rankscroreupdate.fontscale = 2.0;
self.hud_rankscroreupdate.archived = false;
self.hud_rankscroreupdate.color = (0.5,0.5,0.5);
self.hud_rankscroreupdate maps\mp\gametypes\_hud::fontPulseInit();
}
}
}
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Map restart
If you have access to globallogic, then I see no reason not to use it. Globallogic already has the functions you are using, you can simply insert your extra functions in them.

Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
Who is online
Users browsing this forum: No registered users and 1 guest