OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Taggart on 13 Feb 2004, 11:06:34

Title: Game Logic
Post by: Taggart on 13 Feb 2004, 11:06:34
Dear All

Is there anyone out there who can explain the subject of Game Logics within the mission editor, what they are about and how to use them?  ???  I have read various tutorials, too many to mention in fact, and it seems to be a subject that is not directly spoken about and often avoided. Co-operation would be greatly appreciated.  ;D
Title: Re:Game Logic
Post by: Marvin on 13 Feb 2004, 11:12:05
There are many posibilities to use gamelogics!
The one could :

target positions! Example if you name the gamelogic, like targethere, and then at the soldier init field type this dowatch targethere, then he will face to this positions!

or

myunit domove getpos targethere

see there are numberous posibilities to use this!

Also the gamelogic can be used with the waypoints! You can add waypoint to gamelogic with or , and statements! This is little advanced!
Title: Re:Game Logic
Post by: Marvin on 13 Feb 2004, 11:13:13
The gamelogic is just "thing" what make some things easier!
Title: Re:Game Logic
Post by: dmakatra on 13 Feb 2004, 11:15:09
Have you tried the search button? This have been explained by Macca (I think) about 5 times or so.

Anyway, here it goes:

Gamelogics are just like any other troop, it's just invisible, can't carry weapons, moves from point A to point B in 0 seconds, can't be player controlled and have 0 AI, thus it makes NOTHING unless it's told to do so.

BIS used them as conversation makers. You see, a game logic moves from A to B extremly fast. So if you have a bunch of WPs with delayers on them, you can make a conversation with it, when GL move to A, X says "Hello", move to B, Y says "Hello, go screw yourself". Get it?

Players and mission editers use them mostly as markers. For example, you need to move a unit without him going anywhere(setpos command), you put out a GL where you want him and type this:
loon1 setpos getpos GL1

Hope it helped a bit.

:beat: *Gets Shot* :beat:
Title: Re:Game Logic
Post by: Marvin on 13 Feb 2004, 11:21:11
Use the gamelogics at you`r own risk!  ;D
Title: Re:Game Logic
Post by: myke13021 on 13 Feb 2004, 11:25:29
Gamelogics are some sort of "Special Units"  ;D you can do a lot with them.

Most common use on MP maps is to determine if a comp is Server or not. Just place a GL and name it server. This is useful when you have scripts that have only to be esecuted on the server (as createvehicle / createunit scripts). Just add the following line on top of your script:

?!local Server: exit

this will exit the script if it is executed on a client.

Another use of GL is (at least i use it for) camera positioning in cutscenes.
Instead of using

_cam camsetpos [x,y,z]

i put a gamelogic in the editor, name it "campos01" and pos the camera on it

_cam camsetpos getpos campos01

in the editor you can now easily drag the camera position around, instead of editing a cam script.
Sure, this would work with any other object too, but there aren't a lot invisible objects like a GL is  ;D

Also you can use GL as a Unit and assign waypoints to make things happen (like calling scripts...AFAIK BIS used GL waypoints for creating the cutscenes, they aren't scripted...remember the mission in CWC where you're in a Jeep and your squad leader was talking to you? this was done with waypointed GL's)

I bet there are a lot more things you can do with GL but i think this gives you a basic idea what GL's are good for....use your imagination and i'm sure you could find more things you could do with them.

:edit:

i should learn to type faster...as i began there weren't any replies...lmao  ;D
Title: Re:Game Logic
Post by: macguba on 13 Feb 2004, 12:10:44
GLs are very powerful.   There is an excellent thread, which I always try to find when this question comes up .... hang on ....

this one (http://www.ofpec.com/yabbse/index.php?board=6;action=display;threadid=9923)

game logic
gamelogic
gl
gls
gamelogics
game logics
Title: Re:Game Logic
Post by: Chris Death on 13 Feb 2004, 12:15:33
http://www.ofpec.com/yabbse/index.php?board=6;action=display;threadid=871;start=0

There's another thread around aswell - i'm sure Macca
will post the link soon  ;)

~S~ CD
Title: Re:Game Logic
Post by: Taggart on 13 Feb 2004, 15:32:26
Some serious reading  ::) Thanks to all who contributed  :D