Duke4.net Forums: Flying camera - Duke4.net Forums

Jump to content

Hide message Show message
Welcome to the Duke4.net Forums!

Register an account now to get access to all board features. After you've registered and logged in, you'll be able to create topics, post replies, send and receive private messages, disable the viewing of ads and more!

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Flying camera

User is offline   Firefly Trooper 

  • 48

#1

I will post a new thread on the cameras because I would like to create a new version. I would like to use the tile 11, to make a floating camera:

Posted Image

I created a new code for this funny thing:

useractor notenemy FLYROBOT WEAK // unused strange flying robot (flying camera ?)
  ifmove 0 move SHUTTLEVELS getv geth
  ifcount 120 move SHUTTLEVELS getv geth randomangle
  cstat 257
  ifhitweapon
  {
    debris SCRAP1 10
    sound GLASS_HEAVYBREAK
    killit
  }
  ifrnd 1 soundonce BUZZER
enda


How can I use it to make a camera with a fixed view? A bit like a classic camera without rotation (with hi-tag).

In my code, the sprite has the following properties:

1. She flies on different angles, with a slow speed.
2. It can be destroyed.
3. She emits a sound (recovered in BETA version v0.99).

Thanks !

This post has been edited by Firefly_Trooper: 03 January 2019 - 03:40 PM

0

User is online   Mark 

  • Honored Donor
  • 2,962

#2

This might be useful. Remove the lines that allow you to manually turn the camera left or right. https://wiki.eduke32...ecurity_Cameras
0

User is offline   Firefly Trooper 

  • 48

#3

Mmh... Add the code camera inside the personal code? Or reverse process?

This post has been edited by Firefly_Trooper: 04 January 2019 - 08:51 AM

0

User is offline   Firefly Trooper 

  • 48

#4

The code "How to Make Controllable Security Cameras" of James AKA JBlade on AMC does not work:

// Stick this anywhere
gamevar EXTRASAVED 0 2
gamevar TEMP 0 0
gamevar TEMP2 0 0
gamevar TEMP3 0 0
gamevar TEMP4 0 0

// The following gets the camera's extra value into a variable, than sets it to 0 to avoid any possible glitches
eventloadactor CAMERA1 getactor[THISACTOR].extra EXTRASAVED setactor[THISACTOR].extra 0 enda

onevent EVENT_GAME
    ifactor CAMERA1
    {
    getplayer[THISACTOR].newowner TEMP
    ifvarvare TEMP THISACTOR
        {
        ifvare EXTRASAVED 1 // Delete this line if you want all cameras to be able to do this
        { 
        getinput[THISACTOR].extbits TEMP2
            ifvarand TEMP2 16 // If the player presses 'turn left'
                {
                getactor[THISACTOR].ang TEMP3 // Get the Camera's angle
                subvar TEMP3 16 // Turn it left (subtracting from an angle turns it left)
                setactor[THISACTOR].ang TEMP3 // Change it to the new value
                }
            ifvarand TEMP2 32 // If the player presses 'turn right'
                {
                getactor[THISACTOR].ang TEMP3 // Get the Camera's angle
                addvar TEMP3 16 // Turn it right (adding to an angle turns it right)
                setactor[THISACTOR].ang TEMP3 // Change it to the new value
                }
            getinput[THISACTOR].bits TEMP3
                ifvarand TEMP3 8192 
                    {
                    getactor[THISACTOR].shade TEMP4
                    ifvarl TEMP4 124
                        {
                        addvar TEMP4 4
                        setactor[THISACTOR].shade TEMP4
                        }
                    }
                ifvarand TEMP3 16384 
                    {
                    getactor[THISACTOR].shade TEMP4
                    ifvarg TEMP4 -128
                        {
                        subvar TEMP4 4
                        setactor[THISACTOR].shade TEMP4
                        }
                    }
        }
        }
    }
endevent


When I want to turn the camera to the right or to the left, it does not turn. If this does not work for single cameras, I will not be able to add this for the floating version.
0

User is online   Trooper Dan 

  • Duke Plus Developer
  • 4,004

#5

Did you set EXTRA on the camera sprite you want to control to 1 like it says in the directions?
0

User is offline   Firefly Trooper 

  • 48

#6

[THISACTOR].extra CAMERA1 ?

Yes!
0

User is online   Trooper Dan 

  • Duke Plus Developer
  • 4,004

#7

I mean you have to actually set it in the map by pressing 'M on the camera sprite and setting it to 1 instead of -1. It's not just a code thing.

EDIT: To clarify, setting EXTRA to 1 after map load won't help as the code is written, because it's not checking EXTRA, it's checking the var EXTRASAVED


This post has been edited by Trooper Dan: 06 January 2019 - 03:33 PM

0

User is offline   Firefly Trooper 

  • 48

#8

Yes, I put the values ​​as a regular camera, based on the game.
0

User is offline   Firefly Trooper 

  • 48

#9

I think I forgot to add the gamevar. I will test again.
0

User is offline   Firefly Trooper 

  • 48

#10

I will also add to this code the direction from top to bottom of the camera.
0

User is offline   Firefly Trooper 

  • 48

#11

I did this in the code:

eventloadactor CAMERA getactor[THISACTOR].extra EXTRASAVED setactor[THISACTOR].extra 1 enda


In Mapster32, I pressed F8 and added 1 to EXTRA.

And that does not work. No way to define the direction.

This post has been edited by Firefly_Trooper: 06 January 2019 - 05:46 PM

0

User is offline   Firefly Trooper 

  • 48

#12

Camera controllables is not work.
0

User is offline   Firefly Trooper 

  • 48

#13

I try the camera again with "extra 1" in Mapster32 and it does not work.
0

User is online   Mark 

  • Honored Donor
  • 2,962

#14

Since you might not be using English layout for your keyboard, make sure that turn left and turn right keys are working in regular game.
0

User is offline   Firefly Trooper 

  • 48

#15

Hi Mark! I have correctly configured my keyboard and the direction arrows for the left "turn to the left" and the same on the other side.
0

User is offline   Firefly Trooper 

  • 48

#16

Code of the controllable camera not fixed. Even adding an "extra 1" in Mapster32
0

User is offline   Firefly Trooper 

  • 48

#17

General camera codes will also be fixed soon.

I wish to be able to destroy the cameras, the control panels, to make a flying camera and especially the famous code of controllable cameras.
0

User is offline   Firefly Trooper 

  • 48

#18

Full control of the cameras work well, except that instead of turning from left to right, they turn up and down.

On my keyboard, the keys 9 and 3 of the numeric keypad, correspond "high" and "low"

What needs to be done so that the cameras can also work from left to right?
0

User is offline   Firefly Trooper 

  • 48

#19

I have tested the code of the controllable camera again and it only works for the view from top to bottom.

Where to find the order for the horizontal view? (from left to right)

Last thing, I set the value of destructible cameras in the USER.CON file to "YES" but I have an identification problem.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks are property of their respective owners. Instead of reading this text, you could be playing Ion Fury! ;) © 2019 Voidpoint, LLC

Enter your sign in name and password


Sign in options