Home   Help Search Login Register  

Author Topic: coordinates and camsettarget  (Read 1289 times)

0 Members and 1 Guest are viewing this topic.

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
coordinates and camsettarget
« on: 12 Jan 2004, 22:42:00 »
Hi! I have this question about cameras:

So I have this cutscene right? With the following 2 lines:

_camera camsettarget _pos
_camera camsetpos [_x,_y,10]

Now, this works perfectly, but this is just really a test. You see what I need is to put in the same coordinatesin camsettarget except for the z coordinate, so I'll get a shot from above. So I use these lines:

_camera camsettarget [_x,_y,0]
_camera camsetpos [_x,_y,10]

Now, when I preview it, the camera shows that yellow-orange-green-whatever looking colour you know? What's wrong? I thought I would get a normal shot from above. Now, when you tell me what's wrong I promise you I will bang my head in my desk, I have had praticly none sleep the past few days. Thanks!

:beat: *Gets Shot* :beat:

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:coordinates and camsettarget
« Reply #1 on: 12 Jan 2004, 22:47:47 »
Can you even target coordinates? Doesn't it have to be an object?  :-[
That and I nearly always use camsetrelpos because you can easily get the camera to a spot in relation to the target with this command.

_cam camsettarget whateverobjectname
_cam camsetrelpos [0,0,10]

would place the camera directly above the whateverobjectname
Not all is lost.

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:coordinates and camsettarget
« Reply #2 on: 12 Jan 2004, 22:52:37 »
You can target coordinates, u do that when using the camera.sqs.

:beat: *Gets Shot* :beat:

EDIT: Here for example, just something I picked from a search on the forum:

_cam camSetTarget [9556.62,9659.40,0.00]
_cam camSetPos [9913.54,9534.66,221.65]
« Last Edit: 12 Jan 2004, 22:54:22 by The real Armstrong »

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:coordinates and camsettarget
« Reply #3 on: 12 Jan 2004, 22:54:45 »
Riiight..  ;D ::)

Well then, have you double triple checked that _x and _y are defined right?
Not all is lost.

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:coordinates and camsettarget
« Reply #4 on: 13 Jan 2004, 07:53:23 »
You mean like something:

hint format ["%1, %2", _x, _y]

something like that? Think so, I'll check again.

:beat: *Gets Shot* :beat:

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:coordinates and camsettarget
« Reply #5 on: 13 Jan 2004, 17:50:45 »
I've tried it now(was in school before, hence the delay before this answer)and it's coords allright.

:beat: *Gets Shot* :beat:

PsyWarrior

  • Guest
Re:coordinates and camsettarget
« Reply #6 on: 13 Jan 2004, 18:25:08 »
Greetings.

Hmm...most interesting. Cam scripts are great fun when they don't work. Can you post the whole script up? it might help us to isolate the problem.

-Supr. Cmdr. PsyWarrior
-Psychic Productions

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:coordinates and camsettarget
« Reply #7 on: 13 Jan 2004, 18:27:49 »
* Artak is shooting blind

Wheoo well well well.. umm.. have you tested the script with a set of "normal" coordinates. I mean instead of

_camera camsettarget _pos
_camera camsetpos [_x,_y,10]

you'd try

_camera camsettarget [3000,3000,0]
_camera camsetpos [3000,3000,10]

Give it a try. Other than that I have nothing more to say  ;D :-\
Not all is lost.

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:coordinates and camsettarget
« Reply #8 on: 13 Jan 2004, 18:42:17 »
I have tried with real coords but I don't want that. I'll put the script up but it's far from finnished yet and I know that some places are wrong and will give error messages, and some commands that looks weird since I ain't done yet, etc, etc.

Code: [Select]
_pos = _this select 0

SS_WhatEverCrapBool = createdialog "SS_Dialog"

_camera = "camera" camcreate [0,0,0]
_camera cameraeffect ["internal","back"]

_x = _pos select 0
_y = _pos select 1
_y = _y - 1
_z = 100
_camera camsettarget [_x,_y,1]
_camera camsetpos [_x,_y,10]
_camera camcommit 0
;titletext [format ["%1 and %2", _x, _y],"Plain"] <---- there ya have your check Artak :)

#loop
setacctime 1
? (SS_NorthBool) : goto "north"
; blah, blah, add some crap here that aint important for ya to read.
~0.5
goto "loop"

#north
_y=_y+50
_camera camsettarget [_x,_y,0]
_camera camsetpos [_x,_y,10]
_camera camcommit 0
SS_NorthBool=false

:beat *Gets Shot* :beat:

PsyWarrior

  • Guest
Re:coordinates and camsettarget
« Reply #9 on: 13 Jan 2004, 18:44:49 »
what are you inputting in _this select 0 (_pos)?

and did it work with the normal coords

-Psy
« Last Edit: 13 Jan 2004, 18:45:38 by PsyWarrior »

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:coordinates and camsettarget
« Reply #10 on: 13 Jan 2004, 18:46:44 »
ya it worked with normal coords.

I execute it via onmapsingleclick

onmapsingleclick {[_pos] exec "SS_Script.sqs"}

PsyWarrior

  • Guest
Re:coordinates and camsettarget
« Reply #11 on: 13 Jan 2004, 18:54:37 »
 :hmm:

Okay, try commenting out all the bits not completely necessary for the camera scripting (_y = _y -1 etc), leaving just the cam commands and the _pos select stuff.

I'm reaching here, but you never know.

-Psy

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:coordinates and camsettarget
« Reply #12 on: 13 Jan 2004, 19:02:22 »
Nope, didn't work. It's in situations like this you just wanna kick some1 from BIS' arse. ;) Or my own, whichever's closest. ;D

:beat: *Gets Banned From OFPEC By Violation Of The Gods* :beat:
« Last Edit: 13 Jan 2004, 19:02:44 by The real Armstrong »

PsyWarrior

  • Guest
Re:coordinates and camsettarget
« Reply #13 on: 13 Jan 2004, 20:16:14 »
Blasphemy!

Anyway, I'm out of ideas for the minuite. The only thing I can suggest is to execute a different script onMapSingleClick that moves a GameLogic to the specified coords, and then target the GameLogic.

I know that that still doesn't solve the immediate problem, but it might be a workaround for the time being.

If I think of anything else I'll be back. Sorry I couldn't be more help right now.

*PsyWarrior strains brain trying to think. Collapses to floor ("FXStandSurDead") and hits head on filing cabinet.*

-PsyraroWir
-siPcyhc Podrutciosn

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:coordinates and camsettarget
« Reply #14 on: 13 Jan 2004, 20:31:55 »
Try it like this.
Code: [Select]
_pos = [3000,3000]

;SS_WhatEverCrapBool = createdialog "SS_Dialog"

_camera = "camera" camcreate [0,0,0]
_camera cameraeffect ["internal","back"]

_x = _pos select 0
_y = _pos select 1
_y = _y - 1
_z = 100
_camera camsettarget [_x,_y,1]
_camera camsetpos [_x,_y,10]
_camera camcommit 0
titletext [format ["%1 and %2", _x, _y],"Plain"] <---- there ya have your check Artak :)
~10

#loop
setacctime 1
? (SS_NorthBool) : goto "north"
; blah, blah, add some crap here that aint important for ya to read.
~0.5
goto "loop"

#north
_y=_y+50
_camera camsettarget [_x,_y,0]
_camera camsetpos [_x,_y,10]
_camera camcommit 0
SS_NorthBool=false
Not all is lost.