Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Need help: I just can't handle the camera...

  1. #1

    Unhappy Need help: I just can't handle the camera...

    SORRY, I didn't say my question correctly: I mean I want to let player control the camera, just as satellite view. Thanks.

    OK, bros:
    I want to create a sattelite view in my mission, and I try several hours but it just can't work. So need help, thx.

    Now I can create a camera in the air, but I can't let the player move the camera. I use
    _keyDownEHId = (findDisplay 46) displayAddEventHandler ["KeyDown","_key = _this select 1;if (_key in (actionkeys 'HeliUp')) then {_cam camSetPos [2300,1000,130];};"];
    , but it tell me TYPE NOTHING, EXPECT BOOL. why? I unpack the UAV module in official files, I think that is similar to mine.

    I unpack other's file (proving ground.utes, thx), found that somebody use such as
    _keyhandler = (findDisplay 46) displayAddEventHandler ["KeyDown", "_this call (PG_logic getVariable ""satcam_keyhandler"")"];
    but I don't know how to use "call" script.
    I saw http://community.bistudio.com/wiki/U...Event_Handlers, but don't know where to put those long codes
    functionName_keyDown = .........
    Well, it seems that I need to learn: 1, handle the camera. 2, make new function and call it. 3, some thing about "displayAddEventHandler". Too complex.

    THANKS
    PS: coming from CN, sorry for my EN.
    Last edited by Dragon Zen; Apr 8 2011 at 06:08.

  2. #2
    Quote Originally Posted by Dragon Zen View Post
    OK, bros:
    I want to create a sattelite view in my mission, and I try several hours but it just can't work. So need help, thx.

    Now I can create a camera in the air, but I can't let the player move the camera. I use , but it tell me TYPE NOTHING, EXPECT BOOL. why? I unpack the UAV module in official files, I think that is similar to mine.

    I unpack other's file (proving ground.utes, thx), found that somebody use such as but I don't know how to use "call" script.
    I saw http://community.bistudio.com/wiki/U...Event_Handlers, but don't know where to put those long codes

    Well, it seems that I need to learn: 1, handle the camera. 2, make new function and call it. 3, some thing about "displayAddEventHandler". Too complex.

    THANKS
    PS: coming from CN, sorry for my EN.
    Hey dude. Be confident, nobody thinks your English is poor and you should be proud of being as a Chinese, don't you think so? Btw, do you have any ID in VME forum? lol.

    Okay joking apart, just getting down to business, maybe here I can only answer you the second question.

    If you wanna to call a function, you should pre-define your script by useing "compile preProcessfile" and "compile preprocessFileLineNumbers" before you start calling it. Each function can return a specific value you want but it relies on how you script it. The syntax is just the same as sqf syntax but you should bear it in your mind that never use "sleep" in your function because it may cause error. Different from normal sqf files, at the end of the function should be the place to indicate the value you wanna to calling without semicolon. It can be easier understood if you've some knowledge on how to scripting.

    P.S. (How strange for two Chinese talk in English here, I prefer Chinese to English if the forum allows me to do that. lol)

  3. #3
    Sergeant
    Join Date
    Jul 23 2010
    Location
    Beijing, China
    Posts
    173
    Author of the Thread
    Haha, I am glad to see Chinese here.
    VME... I forget whether I have a ID there, because most time I go to SAMREN.

    OK, it seems that I have much to learn to handle the camera.

  4. #4
    I shall not insult moderators
    Join Date
    Nov 25 2010
    Posts
    1,576
    OK you got as far as:
    Code:
    this exec "camera.sqs";
    in the init line of the player to get a camera?

    Camera movement:
    http://community.bistudio.com/wiki/camera.sqs

    Camera commands:
    http://community.bistudio.com/wiki/C...Camera_Control

    Then have a look on youtube and on this thread:
    http://forums.bistudio.com/showthrea...t=82020&page=3

    -You will need to move the camera up to get a satellite view: shift + Q
    -Then tilt down: Keyboard - Number pad - 2.
    -Left click mouse to get camera position in clipboard.
    -Alt+Tab to desktop and paste in Notepad or text editor of your choice.

    To use your camera position - see my posts in the thread above. You can either create a camera script and run it during the mission or create an intro to run at the beginning of the mission.
    Last edited by PELHAM; Apr 4 2011 at 09:13.

  5. #5
    I shall not insult moderators
    Join Date
    Nov 25 2010
    Posts
    1,576
    Try this simple satelite style zoom in , switch to thermal imaging script for the airfield on Utes Island.

    Use a radio trigger or save it as initIntro.sqf to use it in the intro.

    Spoiler:

  6. #6
    Sergeant
    Join Date
    Jul 23 2010
    Location
    Beijing, China
    Posts
    173
    Author of the Thread
    THANK YOU PELHAM. I have some question:

    Camera.sqs can let player control the camera directly? Thus, how can I forbid some functions (sattelite can't head up and head down)?? And the scripts in 5# seems can't control by player.

    What's more, I real want to learn how to define the input (such as KeyDown), this is a useful function.
    Last edited by Dragon Zen; Apr 6 2011 at 03:08.

  7. #7

    Talking

    Quote Originally Posted by Dragon Zen View Post
    What's more, I real want to learn how to define the input (such as KeyDown), this is a useful function.

    in init.sqf put this at bottom.
    PHP Code:

    // do like this and have a function in that file called MY_CAM_KEYDOWN_FNC and MY_CAM_KEYUP_FNC
    call compile preprocessFileLineNumbers "camera\cam_key_fnc.sqf";    

    //or in init.
    MY_CAM_KEYDOWN_FNC =
    {
        switch (
    _this) do {
            
    //Button 2
            
    case 3: {
                  
    titletext["I just pressed button 2. but i can do more here""PLAIN"];
            };
        };
    };
    MY_CAM_KEYUP_FNC =
    {
        switch (
    _this) do {
            
    //Button 2
            
    case 3: {
                  
    titletext["I just relesed button 2. but i can do more here""PLAIN"];
            };
        };
    };



    WaitUntil {!IsNull (FindDisplay 46)};
    (
    findDisplay 46displayAddEventHandler ["KeyDown","_this select 1 call MY_CAM_KEYDOWN_FNC;false;"];
    (
    findDisplay 46displayAddEventHandler ["KeyUp","_this select 1 call MY_CAM_KEYUP_FNC;false;"]; 
    there is also a way to contol the camera by mouse movement. but that require you to make a custom camscript combined with dialog.

    my latest work using camera.
    http://www.youtube.com/watch?v=lgy3x...eature=related
    Last edited by nuxil; Apr 6 2011 at 04:04.

    -- BEC, Battleye Extended Controls --
    -- BEC Forum Thread --

    Spoiler:

  8. #8
    I shall not insult moderators
    Join Date
    Nov 25 2010
    Posts
    1,576
    Hi Dragon,

    My script is for a non player controlled camera scene.

    If you want a player controlled satellite camera you will need to find a script somewhere. Either search here or try Armaholic.com

  9. #9
    @Dragon Zen: Well, I can tell you about my project of Satellite view. There´s a link on armaholic.com

  10. #10
    Sergeant
    Join Date
    Jul 23 2010
    Location
    Beijing, China
    Posts
    173
    Author of the Thread

    Wink

    Quote Originally Posted by chicago View Post
    @Dragon Zen: Well, I can tell you about my project of Satellite view. There´s a link on armaholic.com
    Haha, thanks CHICAGO. I want to learn sattelite from you, and add you in my thankslist then.

    I saw your SATCOM, but it is too complex. My need is simple now, I just want to know how to let player handle the camera. It seems the KeyDown function combines more than one sqf, so I can't learn it from others' scripts. I saw the wiki but don't understand it yet.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •