OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: websnake on 02 Oct 2005, 00:03:34

Title: teleport flag pole
Post by: websnake on 02 Oct 2005, 00:03:34
I dont no if this will work but i want to make a c+h but different to most others.

I want to make it so every 5mins or so the flag teleports somewhere else so the teams will have to go capture it again and it will also stop camping little gits. Also if for example if west has captured the flag and it teleports, the flag will go back to neutral.

Would this be posible? and if so can someone share it with me please

Title: Re:teleport flag pole
Post by: ROBINO on 02 Oct 2005, 00:53:16
try something like this:

you need 10 gamlogics named log0 to log9
1 gamelogic called server
1 flagpole called flagname
call this script from init.sqs or from a trigger
you want only 1 instance of this script running cos setpos effects all machines

Code: [Select]

?!(local server): exit

_rand = 0


#mainloop
~300
_rand = random 10
?(_rand == 0): flagname setpos (getpos log0)
?(_rand == 1): flagname setpos (getpos log1)
?(_rand == 2): flagname setpos (getpos log2)
?(_rand == 3): flagname setpos (getpos log3)
?(_rand == 4): flagname setpos (getpos log4)
?(_rand == 5): flagname setpos (getpos log5)
?(_rand == 6): flagname setpos (getpos log6)
?(_rand == 7): flagname setpos (getpos log7)
?(_rand == 8) flagname setpos (getpos log8)
?(_rand == 9: flagname setpos (getpos log9)
goto "mainloop"



this should move the flag around every 5 minutes - thats IF the flag texture follows the flagpole around -  you may need to refresh it using:


Code: [Select]

flagname setflagtexture "sometexture.jpg"



as to how you get capture and hold scripts working properly i dunno
Title: Re:teleport flag pole
Post by: Platoon Patton on 02 Oct 2005, 01:17:48
Few remarks:

-_rand = 0 // no need to declare

-_rand = random 10 will give u something like 7.256
Use _rand = (random 10 - (random 10 mod 1))

-Gamelogics are big flags in the editor,hard to position.
Better use markers,U can set them to empty when game starts,use getmarkerpos instead of getpos.

-U also have to setpos the triggers around the flags ;)

Title: Re:teleport flag pole
Post by: wi77ard on 03 Oct 2005, 02:03:11
good to see you and robino getting a nice mission working, will be great for inter-clan matches. B sqn is going to loose!