Jump to content
Sign in to follow this  
AKK

Gamelogics

Recommended Posts

I am still pretty new to the whole editing thing. I have a pretty solid basic knowledge of scripting, and making missions although I am still unclear of the total range of use of game logics. I know that they are "invisible" objects but what good are they. I see people use them like markers in scripts. But I am still laking a good grasp of what the heck to do with them. I use the CoC gamelogics often but the BIS gamelogics still stump me. Any comments would be appreciated smile_o.gif

Share this post


Link to post
Share on other sites

Don't know, maybe better uses are possible, bat I use them as rapidly moveable targets for "ShootToNoOne" animations, centres of areas which act in some way if someone gets close, waypoints to move units or groups to and so on... till now I only used those custom GLogics of the game editor

Share this post


Link to post
Share on other sites

Good question!

I've seen it beeing used for dozens and dozens of purposes. One of the oddest purposes is using it as a pilot of a helicopter.... I've got 3 years of experience in mission editing and still I know like 1% of its possible purposes, eventhough I don't think I need to use it for such thingies anyway. I use the game logic mostly as invisible object as you mentioned. It's very handy in marking positions of various things.

Share this post


Link to post
Share on other sites

To add to this question why would you add a gamelogic called server. I seen this in several missions. Does this have something to do with multiplayer. No waypoints for the gamelogic are visible.

Share this post


Link to post
Share on other sites

If you see a gamelogic called Server in a mission, it is usually called in a script using this line <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?! (local Server) : ExitThis method makes all the players exit the script, but not the actual game server, so it allows server-only scripts to run so it doesnt desync or lag the other players, it works this way because a gamelogic is always "local" to the server and nothing else.

Share this post


Link to post
Share on other sites
If you see a gamelogic called Server in a mission, it is usually called in a script using this line <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?! (local Server) : Exit
This method makes all the players exit the script, but not the actual game server, so it allows server-only scripts to run so it doesnt desync or lag the other players, it works this way because a gamelogic is always "local" to the server and nothing else.

Hey, I'd like to know a bit more about this. You see, I haven't made too many MP missions and I'd like to know how to make a script based dynamic weather changing script properly. Everything else works in it but the weather tends to change in different ways on each comp, so it's nice and clear weather in one comp and a complete rains storm in other and this is driving me nuts. Do I just add a 'server' named game logic and add "?! (local Server) : Exit" to the script, or?

Share this post


Link to post
Share on other sites
If you see a gamelogic called Server in a mission, it is usually called in a script using this line <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?! (local Server) : Exit
This method makes all the players exit the script, but not the actual game server, so it allows server-only scripts to run so it doesnt desync or lag the other players, it works this way because a gamelogic is always "local" to the server and nothing else.

Hey, I'd like to know a bit more about this. You see, I haven't made too many MP missions and I'd like to know how to make a script based dynamic weather changing script properly. Everything else works in it but the weather tends to change in different ways on each comp, so it's nice and clear weather in one comp and a complete rains storm in other and this is driving me nuts. Do I just add a 'server' named game logic and add "?! (local Server) : Exit" to the script, or?

Not exactly, I'm presuming the weather is "random" correct? in that case your probably using the random command, and since all computers exec this it will always be different, the fix for this is to just have the server determine the random variable, then send it to all players

IE something like this, a weather script ive got lying around...<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

? local Server : Weather = random 1

? local Server : publicvariable "Weather"

?Weather >0 AND Weather <=0.2 : 0 setovercast 0.2

?Weather >0.2 AND Weather <=0.4 : 0 setovercast 0.4

?Weather >0.4 AND Weather <=0.6 : 0 setovercast 0.6

?Weather >0.6 AND Weather <=0.8 : 0 setovercast 0.8

?Weather >0.8 AND Weather <=1 : 0 setovercast 1

That way, only the server determines what the random number will be, and sends it out to all players, so you should have the same weather.

Share this post


Link to post
Share on other sites
If you see a gamelogic called Server in a mission, it is usually called in a script using this line <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?! (local Server) : Exit
This method makes all the players exit the script, but not the actual game server, so it allows server-only scripts to run so it doesnt desync or lag the other players, it works this way because a gamelogic is always "local" to the server and nothing else.

Hey, I'd like to know a bit more about this. You see, I haven't made too many MP missions and I'd like to know how to make a script based dynamic weather changing script properly. Everything else works in it but the weather tends to change in different ways on each comp, so it's nice and clear weather in one comp and a complete rains storm in other and this is driving me nuts. Do I just add a 'server' named game logic and add "?! (local Server) : Exit" to the script, or?

Not exactly, I'm presuming the weather is "random" correct? in that case your probably using the random command, and since all computers exec this it will always be different, the fix for this is to just have the server determine the random variable, then send it to all players

IE something like this, a weather script ive got lying around...<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

? local Server : Weather = random 1

? local Server : publicvariable "Weather"

?Weather >0 AND Weather <=0.2 : 0 setovercast 0.2

?Weather >0.2 AND Weather <=0.4 : 0 setovercast 0.4

?Weather >0.4 AND Weather <=0.6 : 0 setovercast 0.6

?Weather >0.6 AND Weather <=0.8 : 0 setovercast 0.8

?Weather >0.8 AND Weather <=1 : 0 setovercast 1

That way, only the server determines what the random number will be, and sends it out to all players, so you should have the same weather.

Ok thanks, I'll look into it. smile_o.gif

Share this post


Link to post
Share on other sites

Thanks everybody. smile_o.gif I guess I will just use them as "targets" and worry too much about using them broadly. wink_o.gif

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×