What I would like to do....

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
G3mInI
First Lieutenant
Posts: 187
Joined: Sat Jun 29, 2002 3:49 am

What I would like to do....

Post by G3mInI »

... is at the beginning of each round and when the first time the map loads, to have the screen go to black, freeze all the players, print a message in the center, and then bring the map into view and release all the players to battle it out. This is for a multiplayer server side mod. I know the commands to black out the screen and bring it back. I know the command for printing a message in the center of the screen. What has me confused is, how to freeze and then release the player, and where in the map.scr these commands should be executed. Here is what I have now and it seems like it works except the player doesnt freeze. Can still walk around in the dark. Now I only have the ability to test locally. I want this to work on a dedicated server. The way I test is type restart in the console.

Script:

main:

// the usual info is here

level waittill prespawn

level waittill spawn


thread target_everyone
wait 5 // put this here to hopefully wait for all players to load the map


local.player freezeplayer // is this right ? Doesn't seem to do a thing

fadeout 0.1 0 0 0 1
huddraw_alpha 100 0 // this and previous line work just fine

exec global/message_print.scr::message level.msg NIL 5 // this message works just fine - not a problem

wait 3.5 // added this to keep screen black while the message prints

fadein 2 0 0 0 1 // works just fine

local.player releaseplayer // well since I'm not frozen this line isn't doing a thing

level waittill roundstart

//rest of map script follows here
end

The thread for target_everyone:

target_everyone:

while (1)
{
for(local.i = 1; local.i <= $player.size; local.i++)
{
local.player = $player[local.i]
waitframe
}
waitframe
}
end



In the console I get the error 'freezeplayer applied to NIL'

Can anyone help me out?

G3mInI
Krane
Lieutenant General
Posts: 782
Joined: Sat May 31, 2003 4:18 pm
Location: California, USA
Contact:

Post by Krane »

to freeze a player use:

freezeplayer

To release a player use:

releaseplayer

Use right b4 the fade command.

I don't think you can do it only when the map loads the 1st time, every time the map starts you'll have the same stuff (freeze, fade, etc...) making it very annoying, but...
Image
User avatar
G3mInI
First Lieutenant
Posts: 187
Joined: Sat Jun 29, 2002 3:49 am

Post by G3mInI »

Well the purpose of the freeze and release and black screen is to display a quick weather message. I have a setup where each round the weather could be completely different from the previous round (randomly chosen). I have cloudy -- light fog -- heavy fog -- light snow and fog -- flurries -- and even rain. All I am trying to do is make a little quick intro to each round saying what the weather will be like for this round. It only displays for 5 seconds.

So you're saying to use freezeplayer and releaseplayer without the local.player statement ? And this will freeze all players currently in the server ?

G3mInI
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Sounds cool but have you tought about the fact not all players enter a server at the same time :?: Usually the first player joins when the server is running for a few seconds, and others could join up to 10 seconds later.
Image
User avatar
G3mInI
First Lieutenant
Posts: 187
Joined: Sat Jun 29, 2002 3:49 am

Post by G3mInI »

hmm good point. And I do see this all the time... seeing a player in suspended animation as the round starts. I am assuming that person is still waiting for the round to start on his/her commodore 64 :lol:

So whilst keeping the random weather effects, the best approach would be to just display this message for maybe like the first 10 seconds and then so be it :?: How bout if it were displayed in the upper left corner in yellow instead of the center of the screen :?: If you see it, fine, if not then oh well. I'd hate to make everyone wait 10 to 15 seconds just display a weather message.

G3mInI
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Yeah you could do that though players will probably notice the weather soon enough :wink:
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

camera

Post by tltrude »

You could also have everyone's view switch to a camera, and turn on third person for everyone, so they see themselves. The camera can also follow a path, or any moving entitiy. Small Sumo is the best at making those start-of-round movies.
Tom Trude,

Image
User avatar
G3mInI
First Lieutenant
Posts: 187
Joined: Sat Jun 29, 2002 3:49 am

Post by G3mInI »

I actually thought about the camera idea. But then I got to thinking about what jv said. If others were late in loading the map then they would not be in the camera view, right ? Also when using camera commands like toggle 3rd person... if it is cheat protected on a server that is running CI and host of other security scripts, would it conflict with that ?

G3mInI
Post Reply