Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,295 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: STREAK/BEAM not working correctly [Re: Widi] #313113
02/27/10 18:30
02/27/10 18:30
Joined: Sep 2009
Posts: 20
U
uniman Offline OP
Newbie
uniman  Offline OP
Newbie
U

Joined: Sep 2009
Posts: 20
the particle effect for the smoke is the same as the one in the
PARTICLE.C script which comes with GS. the one described just
effect(particle_smoke,8,hit.x,NULLVECTOR), inside the ray trace definition for the gun(a seperate function which traces a ray with enable_shoot, scan_texture, etc.), if the trace hits
a NULL object(if(you==NULL)) it goes to that effect. however, as I said. it does this with any type of effect, even particle generators. so it's not just where the effect() command was triggered.

Re: STREAK/BEAM not working correctly [Re: uniman] #313245
02/28/10 14:47
02/28/10 14:47
Joined: Sep 2009
Posts: 20
U
uniman Offline OP
Newbie
uniman  Offline OP
Newbie
U

Joined: Sep 2009
Posts: 20
I have another update with the problem. I downloaded the guild wars camera clone, and changed my script slightly so I could test it. The flags seem to work fine with that camera. I still
cannot figure out why it won't work with the cam code I posted though. anyone else have an idea?

Re: STREAK/BEAM not working correctly [Re: uniman] #313258
02/28/10 15:14
02/28/10 15:14
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
The problem has nothing to do with your camera code.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: STREAK/BEAM not working correctly [Re: Superku] #313262
02/28/10 15:21
02/28/10 15:21
Joined: Sep 2009
Posts: 20
U
uniman Offline OP
Newbie
uniman  Offline OP
Newbie
U

Joined: Sep 2009
Posts: 20
then why does the streak flag work when I use the 3rd person camera code from the wiki, but doesn't work with my cam code?

Re: STREAK/BEAM not working correctly [Re: uniman] #313297
02/28/10 17:09
02/28/10 17:09
Joined: Oct 2004
Posts: 900
Lgh
rojart Offline
User
rojart  Offline
User

Joined: Oct 2004
Posts: 900
Lgh
Quote:
Perhaps I have the same bug.
If you create a particle with the BEAM flag there is a horizontal line from the particle position to the right side of the screen


BEAM & STREAK only work with Gamestudio/A7 Commercial+ version (Low versions don't support BEAM), what version of A7 do you use?

When pro then post your whole code to check what happens.


Last edited by rojart; 02/28/10 17:15.

Regards, Robert

Quote
Everything should be made as simple as possible, but not one bit simpler.
by Albert Einstein

PhysX Preview of Cloth, Fluid and Soft Body

A8.47.1P
Re: STREAK/BEAM not working correctly [Re: rojart] #313301
02/28/10 17:16
02/28/10 17:16
Joined: Sep 2009
Posts: 20
U
uniman Offline OP
Newbie
uniman  Offline OP
Newbie
U

Joined: Sep 2009
Posts: 20
as I said before, I am using the pro edition. also if I were not using a version which allows it, then it wouldn't show up with the other code. And my camera code is in the first post,
except that I have changed the if statement for the camera.tilt
max and min with a clamp(camera.tilt,-20,40).

Re: STREAK/BEAM not working correctly [Re: uniman] #313309
02/28/10 17:51
02/28/10 17:51
Joined: Oct 2004
Posts: 900
Lgh
rojart Offline
User
rojart  Offline
User

Joined: Oct 2004
Posts: 900
Lgh
Can you extend this code with your cam code?

Code:
///////////////////////////////
// Particle trail example
// (c) jcl / oP group 2009
// Gamestudio/A7 Commercial+ only
// Low versions don't support BEAM
///////////////////////////////
#include <acknex.h>
#include <default.c>

function p_alphafade(PARTICLE *p)
{
    p.alpha -= p.skill_a*time_step;
    if (p.alpha <= 0) p.lifespan = 0;
}

function p_trace(PARTICLE *p)
{
   set(p,TRANSLUCENT|BEAM);
   p.alpha = 100;
   p.size = 2;
   p.skill_a = 3; // fade factor
   p.event = p_alphafade;
}

action satellite()
{
   var dist = 0,radius = 10,sign = 1;
   VECTOR last_pos;
   while(1) 
   {
      vec_set(last_pos,my.x);
      dist += 30*time_step;
      radius += sign*random(2)*time_step;
      if (radius > 100) sign = -1;
      else if (radius < 10) sign = 1;
      my.x = radius*sin(dist);
      my.y = radius*cos(dist);
      effect(p_trace,1,my.x,vec_sub(last_pos,my.x));
      wait(1);
   }
}

function main()
{
  vec_set(screen_size,vector(800,300,0));
  vec_set(sky_color,vector(50,1,1)); // dark blue
  d3d_antialias = 4;
  video_window(NULL,NULL,0,"Particle trail demo");
  
  level_load(NULL); // necessary for 3D particles
  vec_set(camera.x,vector(-150,0,20));
  vec_set(camera.pan,vector(0,-10,0));
  vec_set(mat_model.ambient_blue,sky_color);  

  ent_create(SPHERE_MDL,vector(0,0,0),NULL);
  ent_create(NULL,vector(0,0,0),satellite);  
}




Regards, Robert

Quote
Everything should be made as simple as possible, but not one bit simpler.
by Albert Einstein

PhysX Preview of Cloth, Fluid and Soft Body

A8.47.1P
Re: STREAK/BEAM not working correctly [Re: rojart] #313501
03/01/10 19:08
03/01/10 19:08
Joined: Sep 2009
Posts: 20
U
uniman Offline OP
Newbie
uniman  Offline OP
Newbie
U

Joined: Sep 2009
Posts: 20
well, it appears I have solved the problem on my own. I re-wrote the lines with vec_set(camera.x,player.x), to read
camera.x = player.x; camera.y = player.y; camera.z = player.z+35; and removed the vec_set(camera.pan,player.pan).
it works perfectly now. this is the final working code,

camera.x = player.x+3;
camera.y = player.y;
camera.z = player.z+40;

player.pan -= 5 * mouse_force.x * time_step;
player.tilt += 3 * mouse_force.y * time_step;

player.tilt = clamp(player.tilt,-20,40);

camera.pan = player.pan;
camera.tilt = player.tilt;

Page 2 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1