Home   Help Search Login Register  

Author Topic: GAMELOGIC  (Read 1138 times)

0 Members and 1 Guest are viewing this topic.

Offline Crowey

  • Members
  • *
GAMELOGIC
« on: 04 Feb 2009, 14:52:21 »
hi guys please move this topic if need be...
I just need to know If there is any good guides around that I can read to tell me what gamelogic is for?lol
I actually know how dumb that question sounds to you guys but iv been making mission for a while now and I always place a gamelogic in my missions but dont know what its for?
I also hear on here people attatching it to groups and waypoints etc? Why? what does this do?

Spare me the "noob" comments, lol we all have to learn?

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
Re: GAMELOGIC
« Reply #1 on: 04 Feb 2009, 15:04:01 »
Well a GL is used for a few things. It is used to sometimes maintain a position. Its sometimes used as a global variable and is often named server. GL placed in the editor and then named server can be used in scripts to check to see if the script is only running on the server. GL are local to the server only. I'm sure there are other reasons but this is one of the more popular uses.
Xbox Rocks

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: GAMELOGIC
« Reply #2 on: 04 Feb 2009, 16:54:14 »
Gamelogics have a host of possible uses, which are really only limited by your own inventiveness. They are by no means -necessary- in a mission, you don't need to put them in your mission unless you want to, but they CAN be used to circumvent a lot of external scripting.

Game logics become really useful when you use them together with their waypoints, of which there are two types: AND and OR. Most of the time you'll only need to use the standard AND-type waypoint. Gamelogics move between their waypoints instantaneously. As an example, you can:

- Use a long line of AND waypoints on a game logic to dictate a conversation (radio or otherwise), by using the  waypoint's Countdown timer to make sure the message has time to display, the On Activation field to display the message (player sidechat "Here we go!"), and potentially the Condition field to pause or continue the conversation as necessary. For instance the GL has a first waypoint, with a condition of 'obj1' : once obj1 is true (you've killed someone or reached a certain location or whatever), then the message in the On Activation field of the waypoint is displayed (which can be whatever, said by whomever; player sidechat "Objective complete!"); add a second AND waypoint after this, and give it a Countdown (or is it timeout? One of the two) Min/Max/Mid of a couple of seconds, and then add a second message to the on activation box (which could for instance be a reply; co1 sidechat "Good job!") -> and so on ad infinitum.

- Use the game logic as an "invisible object" that can for instance activate triggers (there's an activated by: game logic option) or be used as a starting point for a camera in a cutscene, units that need to be moved out of the way or into the way (used together with setpos and getpos), and so on and so forth.

- What few people realize is that the GL is a unit -> it can be moved into vehicles and the like using moveindriver/cargo/gunner. By using an invisible GL, you can for instance occupy the front seat of a helicopter (the co-pilot's seat) with a GL, which will make everyone else getting into the chopper get in the back. Or you could populate a bus with invisible GLs to make sure only certain seats are accessible (e.g. for cutscenes etc.). GLs can also be ordered to doTarget and doFire: so you can for instance put the GLs inside a gunner position and order it to shoot at people like an "unmanned" gun.

- Don't quote me on this, but I believe the OR waypoint has a special use too -> by synchronizing TWO (or more!) triggers (or waypoints?) to the OR waypoint, the On Activation field of the GL waypoint will fire when ANY of the conditions attached to the waypoint are reached. So say for instance you want the player to get a message EITHER when he reaches his waypoint OR when a certain unit has entered the area, you could simply synch them both to the GL which does the messaging for you.

So yes : GLs have a ton of uses, and the above are just some thoughts and situations -I've- used them in. I'm sure there's tons more! Have fun!

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
Re: GAMELOGIC
« Reply #3 on: 04 Feb 2009, 17:23:18 »
Wow I didn't know you could do all that stuff with the GL. Thanks for the read Wolfrug.
Xbox Rocks