OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Nemesis6 on 24 Aug 2004, 01:40:14

Title: Which island are we on?
Post by: Nemesis6 on 24 Aug 2004, 01:40:14
Here's the thing - I need some sort of algorithm/whatever, to determine what island the player is on. Here's what I've tried --

? "klovi2" countType ["Object 2745"]: blah blah blah.

You see the concept, right? One object is never the same on all the islands, so it could specify which island it is... Anyway, help? I just can't get it to work.
Title: Re:Which island are we on?
Post by: AnarCHy on 24 Aug 2004, 01:43:20
Why exactly would you need to know which island the player is on...?

ehhe....
AnarCHy
Title: Re:Which island are we on?
Post by: Nemesis6 on 24 Aug 2004, 01:46:16
Now that's just a stupid response.
Title: Re:Which island are we on?
Post by: AnarCHy on 24 Aug 2004, 01:52:20
Now that's just a stupid response.

Either I misunderstood, or you misunderstood what I was saying...


I was asking, that if you placed the unit (player) on Kulgojev, wouldn't you already know which island you were on?
Title: Re:Which island are we on?
Post by: Nemesis6 on 24 Aug 2004, 02:36:58
Yes, but the game woulden't. Neither would any of the scripts in my mod.
Title: Re:Which island are we on?
Post by: WizzyWig on 24 Aug 2004, 02:58:14
look at bas choppers it has a island script on it that looks at sothing and then tells you what island your on

Code: [Select]
_origin = "EmptyDetector" camcreate [0,0,0]

_origin setpos [6400, 3000, 0]
_p1 = (getpos _origin select 2) - ((getpos _origin select 2) Mod 1)
_origin setpos [6400, 6400, 0]
_p2 = (getpos _origin select 2) - ((getpos _origin select 2) Mod 1)
_origin setpos [6400, 9800, 0]
_p3 = (getpos _origin select 2) - ((getpos _origin select 2) Mod 1)
_origin setpos [3000, 6400, 0]
_p4 = (getpos _origin select 2) - ((getpos _origin select 2) Mod 1)
_origin setpos [9600, 4100, 0]
_p5 = (getpos _origin select 2) - ((getpos _origin select 2) Mod 1)
camdestroy _origin
? ((_p1>=-2 && _p1<=0) && _p2==-141 && _p3==-2 && _p4==-80 && _p5==-136) :mapset = 1;goto "everon"
? ((_p1>=-2 && _p1<=0) && (_p2>=-2 && _p2<=0) && (_p3>=-2 && _p3<=0) && (_p4>=-2 && _p4<=0) && _p5==-29) : mapset = 2;goto "desert"
? (_p1==-49 && _p2==-269 && _p3==-177 && _p4==-231 && _p5==-35) : mapset = 3;goto "malden"
? (_p1==-36 && _p2==-136 && _p3==-324 && _p4==-48 && _p5==-135):mapset = 5; goto "nogova"
? ((_p1>=-2 && _p1<=0) && _p2==-19 && _p3==-9 && _p4==-335 && (_p5>=-2 && _p5<=0)):mapset = 6; goto "iadrang"
? ((_p1>=-2 && _p1<=0) && _p2==-449 && (_p3>=-2 && _p3<=0) && _p4==-226 && (_p5>=-2 && _p5<=0)):mapset = 7; goto "kolguyev"

;Start not suported
mapset = 4
goto "noisland"
;End Not Suported

#everon
_map = mapset
_gridpic = format ["\wizmapsys\map\%1\map%1.jpg",_map]
_pic = _gridpic
goto "mapshow"

#Desert
_map = mapset
_gridpic = format ["\wizmapsys\map\%1\map%1.jpg",_map]
_pic = _gridpic
goto "mapshow"

#malden
_map = mapset
_gridpic = format ["\wizmapsys\map\%1\map%1.jpg",_map]
_pic = _gridpic
goto "mapshow"

#Nogova
_map = mapset
_gridpic = format ["\wizmapsys\map\%1\map%1.jpg",_map]
_pic = _gridpic
goto "mapshow"

#Iadrang
_map = mapset
_gridpic = format ["\wizmapsys\map\%1\map%1.jpg",_map]
_pic = _gridpic
goto "mapshow"

#Kolguyev
_map = mapset
_gridpic = format ["\wizmapsys\map\%1\map%1.jpg",_map]
_pic = _gridpic
goto "mapshow"

#noisland
_map = mapset
_gridpic = format ["\wizmapsys\map\%1\map%1.jpg",_map]
_pic = _gridpic
goto "mapshow"

#mapshow
ctrlsettext [(799) ,format["%1",_pic]]
this exec "idctext.sqs"
exit
Title: Re:Which island are we on?
Post by: macguba on 24 Aug 2004, 10:04:17
ECP also has an island detection routine.
Title: Re:Which island are we on?
Post by: Nemesis6 on 24 Aug 2004, 14:52:55
Well, sorry for any misunderstandings... Anyway, I've looked at both of those before, and suprisingly, I coulden't get them to work... But I only need to determine if it's Desert Island or not, so I just asked the game -

? (alive object 1): guess
?! (alive object 0): guess again

Thanks anyway.
Title: Re:Which island are we on?
Post by: Planck on 24 Aug 2004, 19:09:41
I don't think Desert Island has any objects........or does it?


Edit:   I had a shot at checking Desert Island.

I placed my self on the island and used a setpos spell to zapp me off to the position of object 1 ( presuming one exists).

I ended up in the water at map reference Zj00 and sometimes Zj99.

No......that isn't a typo........I know the map only goes as far as Jj99.......but that was the map reference I got.



Planck
Title: Re:Which island are we on?
Post by: Tomb on 24 Aug 2004, 22:31:10
lol :o ;D
Title: Re:Which island are we on?
Post by: Nemesis6 on 25 Aug 2004, 01:04:55
Heh, just for the sake of amusement, try this -

Condition: alive player

On Activation: hint format ["%1", typeOf (object 1)]

Would be fun to know what object it is...

EDIT: Wait a minute..... there is no object, that's why it's giving such a strange position... Damn it! :-/

Anyway, Object 1 on Malden is a small lump of grass on one of the small islands! :-/
Title: Re:Which island are we on?
Post by: Planck on 25 Aug 2004, 01:24:20
Try this little script.

Put it in any mission as init.sqs, or part thereof.

It will tell you which island you are on from out of the original 4.

it = (typeof (object 0))
? it == "FuelStation" : hint "You are on Everon" ; exit

it = (typeof (object 666))
? it == "Housegaraz_bez_tanku" : hint "You are on Malden" ; exit

it = (typeof (object 2730))
? it == "Houseafdum_mesto3" : hint "You are on Kolgujev" ; exit

hint "You are on Desert Island"

exit


Planck