English How can I use the camera

4 replies
Goto Page
To the start Previous 1 Next To the start
26.10.17 05:48:55 pm
Up
Fr3sh S0ftwar3
Super User
Offline Off
I have been working on making my own adventure map, and I don't know how the camera works.
I have tried to make sense of it by looking at other maps, but they are too garbled with a bunch of other codes and stuff.
Download Now--->Stranded II Enhanced<---Download Now
27.10.17 01:45:34 am
Up
JasJack67
Super User
Offline Off
Hi Fresh,
Here is a Telescope script using the camera. It simply zooms the camera in to a distant place, a place ahead of the player where ever he is looking.

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
### Screen Effect - Telescope
id=3815
name=Screen_Telescope
group=stuff
icon=gfx\blank.bmp
model=gfx\effects\screen_telescope.b3d
scale=1
alpha=1
col=0
mat=dust
autofade=2000
script=start
     on:create {
        timer "self",200,1,"timer1";
     }
    on:timer1 {
          local $x1,$y1,$z1,$x2,$y2,$z2,$yaw,$pitch,$radius,$info1,$info2;
          $x1=getx("unit",1);
          $y1=gety("unit",1);
          $z1=getz("unit",1);
          $x2=$x1;
          $y2=$y1;
          $z2=$z1;
          $y2+=16;
          $yaw=getyaw("unit",1);
          $pitch=getpitch("unit",1);
          $radius=1000;
          $x2-=((sin($yaw)*$radius)/100);
          $z2+=((cos($yaw)*$radius)/100);
          $y2-=((sin($pitch)*$radius)/100);
          $info1=create("info",40,$x2,$z2);
          setpos "info",$info1,"self",$y2,"self";
          $x2-=((sin($yaw)*$radius)/100);
          $z2+=((cos($yaw)*$radius)/100);
          $y2-=((sin($pitch)*$radius)/100);
          $info2=create("info",30,$x2,$z2);
          setpos "info",$info2,"self",$y2,"self";
          seqstart 1,1;
          setcam 0,$info1;
          cammode 0,1,"info",$info2;
          seqend 5000;
          timer "self",5200,1,"timer2";
     }
     on:timer2 {
         free "self";
     }


The player has a Telescope. On:use, this screen effect is created. So that runs first above, on:create. Then the expiring timer starts the timer1 script.

Here, the camera moves straight out in front of the players view (center of screen). So the angles need to be set, yaw,pitch,sin,cos.

Info 40 is camera position in the infos.inf file. Info 30 is a flag placed on the map that the camera goes towards.

So the camera move in that direction for 5000 or 5 seconds. Then it is deleted "free "self"" and the player now returns to normal play camera view.

Code:
1
2
3
4
seqstart 1,1;
          setcam 0,$info1;
          cammode 0,1,"info",$info2;
          seqend 5000;


There is only 1 sequence, the camera moving from the player to the flag.
Setcam tells where the camera is going. To info1.
Cammode 0 moves the camera toward info2
Seqend tells the sequence to end in 5000/5 seconds.

Thus the timer to delete it's self right after it reaches 5 seconds away, is set at 5200.
edited 1×, last 27.10.17 02:00:47 am
The Survivalist_11-23-17 is now available. DOWNLOAD HERE >The Survivalist 11-23-17 | Performance-In options keep Water Detail off
02.11.17 09:37:03 pm
Up
Fr3sh S0ftwar3
Super User
Offline Off
This sounds like a lot of work. Forget I asked.
Download Now--->Stranded II Enhanced<---Download Now
03.11.17 12:42:07 pm
Up
Assassin moder
User
Offline Off
It is easier than you might think. Do not try to code/script if you are going to surrender anyway. An you are calling yourself a Software? Ironic ..
03.11.17 03:50:41 pm
Up
Fr3sh S0ftwar3
Super User
Offline Off
I think I get the concept, I just looked at the whole script and said "I'll never figure this out"
edited 3×, last 09.11.17 03:58:10 am
Download Now--->Stranded II Enhanced<---Download Now
To the start Previous 1 Next To the start