2 registered members (AndrewAMD, NeoDumont),
761
guests, and 1
spider. |
Key:
Admin,
Global Mod,
Mod
|
|
|
[SOLVED] vec_for_screen camera shaking
#459664
05/30/16 12:04
05/30/16 12:04
|
Joined: Dec 2011
Posts: 1,823 Netherlands
Reconnoiter
OP
Serious User
|
OP
Serious User
Joined: Dec 2011
Posts: 1,823
Netherlands
|
Hi, I use vec_for_screen to position several entities for the game interface. But for some reason the vec_for_screen line in the code below results in that the entity constantly switches position a bit (as if it is a vibrator lol ). camera constantly changes position.
while(1) {
vec_set(my.x, vector(50, 50, 0)); // x/y test values
my.z = 50; //depth
vec_for_screen(my.x, camera);
vec_set(my.pan, camera.pan);
wait(1);
}
Besides that shaking, the camera itself stands still by the way. If I comment the line "vec_for_screen(my.x, camera);" out, the problem goes away. But I would like to use vec_for_screen obviously.
Last edited by Reconnoiter; 05/30/16 13:17.
|
|
|
Re: vec_for_screen camera shaking
[Re: Reconnoiter]
#459667
05/30/16 13:16
05/30/16 13:16
|
Joined: Dec 2011
Posts: 1,823 Netherlands
Reconnoiter
OP
Serious User
|
OP
Serious User
Joined: Dec 2011
Posts: 1,823
Netherlands
|
Oh stupid me, the inventory slots were catched by a trace for the camera code. I will leave this thread here cause I quess its easy to make this mistake.
Last edited by Reconnoiter; 05/30/16 13:17.
|
|
|
Re: vec_for_screen camera shaking
[Re: Reconnoiter]
#459682
05/30/16 20:42
05/30/16 20:42
|
Joined: Jul 2008
Posts: 2,107 Germany
rayp
X
|
X
Joined: Jul 2008
Posts: 2,107
Germany
|
And for all beginners facing this problem, and can help here ( besides PASSABLE and IGNORE_PASSABLE flags ). Greets
Acknex umgibt uns...zwischen Dir, mir, dem Stein dort... "Hey Griswold ... where u gonna put a tree that big ?" 1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected rayp.flags |= UNTOUCHABLE;
|
|
|
Re: vec_for_screen camera shaking
[Re: rayp]
#459688
05/31/16 09:34
05/31/16 09:34
|
Joined: Dec 2011
Posts: 1,823 Netherlands
Reconnoiter
OP
Serious User
|
OP
Serious User
Joined: Dec 2011
Posts: 1,823
Netherlands
|
I might as well give another tip now, you can use Define for 'groups' too to make your code cleaner and better readable, example:
//collision groups
#define ALLY_GROUP 1
#define ENEMY_GROUP 2
#define NATURE_GROUP 3
#define ITEM_GROUP 4
....
action squirrel() {
my.group = NATURE_GROUP;
...
}
function convert_squirrels() {
c_ignore(ALLY_GROUP, ITEM_GROUP, 0); //only enemies or nature
if (c_trace(..., ..., ...) > 0) {
if (you) you.group = ALLY_GROUP;
}
}
Maybe a bit offtopic though
Last edited by Reconnoiter; 05/31/16 09:38.
|
|
|
Re: vec_for_screen camera shaking
[Re: rayp]
#459744
06/02/16 16:11
06/02/16 16:11
|
Joined: Dec 2011
Posts: 1,823 Netherlands
Reconnoiter
OP
Serious User
|
OP
Serious User
Joined: Dec 2011
Posts: 1,823
Netherlands
|
Maybe a bit offtopic though grin Thats totally ok in this case of usefull well written script example! , tnx, I thought the addition of squirrels would really add something
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|