Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (vicknick, AndrewAMD), 1,292 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Particle ploblem in Lite-C #212895
06/24/08 22:37
06/24/08 22:37
Joined: Jul 2005
Posts: 262
Earth, The Netherlands
NL_3DGS_n00b Offline OP
Member
NL_3DGS_n00b  Offline OP
Member

Joined: Jul 2005
Posts: 262
Earth, The Netherlands
Hi,

I made a particle script with EasyParticle 3.1, and I am trying to convert the generated script to Lite-C...
I am having some problems with it, I am fixing every error I find trying to run the script, but it sticks with my.vel_x (and y and z), if I comment it, so the script moves on, it stops at my.lifespan...

Are these commands changes in Lite-C?
This is my WDL script, can someone please take a look at it?
Or explain what kind of particle related commands are changed?

Thank you.

This is my WDL code:

I have already changed some things:

- bmap -> BMAP*
- Function -> function (Changed capital F to lower)
- My -> my (Changed capital M to lower)
- action actionname{ -> action actionname(){
- the flags in c_trace
- time -> time_step


Code:
BMAP* sun_farbe1 = "sun_red.tga";
var laserAAnzahlPartikel = 20;


function laserA_spec_fun()
{
    c_trace(vector(my.skill_d,my.skill_y,my.skill_z),my.x,IGNORE_ME|IGNORE_PASSABLE|IGNORE_MODELS|IGNORE_SPRITES);
    if(trace_hit == 1)
    {
      my.vel_x = 0;
      my.vel_y = 0;
      my.vel_z = 0;
      my.lifespan = 0;
    }
    my.skill_d = my.x; my.skill_y = my.y; my.skill_z = my.z;
    my.alpha -= 4.909 *time_step;
    if(my.alpha < 0) { my.alpha = 0; my.lifespan = 0; }
}

function laserAspezial()
{
    my.blue = 128 ;
    my.green = 128 ;
    my.red = 128 ;
    my.bmap = sun_farbe1;
    my.vel_x = random( 33.867 ) - 16.934 ;
    my.vel_y = random( 0 ) - 0 ;
    my.vel_z = random( 0 );
    my.size = 1 ;
    my.alpha = 21.738 ;
    my.gravity = 0 ;
    my.streak = off;
    my.flare = off;
    my.bright = on;
    my.beam = off;
    my.move = on;
    my.transparent = off;
    my.function = laserA_spec_fun;
}


function laserA()
{
  while(1)
  {
     laserAAnzahlPartikel = 20;
     effect(laserAspezial,max(1,laserAAnzahlPartikel*time_step),my.x,nullvector);
     wait(1);
  }
}


action laserA_action()
{
  my.invisible = on;
  my.passable = on;
  while(!key_q) { wait(1); }
  laserA();
}


P.S.
Will there be a Lite-C version of EasyParticle someday?


The best games are the games you create yourself.
Re: Particle ploblem in Lite-C [Re: NL_3DGS_n00b] #212914
06/25/08 00:03
06/25/08 00:03
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
try using it as:

function laserAspezial(PARTICLE* p)


and change all "my"s to "p".

p.s BRIGHT,BEAM,MOVE are flags. use set/reset insteod of on/off s.
p.p.s. FLARE is obsolete, delete this line.


3333333333
Re: Particle ploblem in Lite-C [Re: Quad] #213051
06/25/08 15:52
06/25/08 15:52
Joined: Jul 2005
Posts: 262
Earth, The Netherlands
NL_3DGS_n00b Offline OP
Member
NL_3DGS_n00b  Offline OP
Member

Joined: Jul 2005
Posts: 262
Earth, The Netherlands
Thank you, the engine is almost at the bottom of the script, now it only returns an error at line 63:
Code:
effect(laserAspezial,max(1,laserAAnzahlPartikel*time_step),p.x,nullvector);

It says:

Error in 'laser1.c' line 63: 'max' undeclared identifier


The best games are the games you create yourself.
Re: Particle ploblem in Lite-C [Re: NL_3DGS_n00b] #213055
06/25/08 16:07
06/25/08 16:07
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
max is changed to maxv .


3333333333
Re: Particle ploblem in Lite-C [Re: Quad] #213063
06/25/08 16:30
06/25/08 16:30
Joined: Jul 2005
Posts: 262
Earth, The Netherlands
NL_3DGS_n00b Offline OP
Member
NL_3DGS_n00b  Offline OP
Member

Joined: Jul 2005
Posts: 262
Earth, The Netherlands
The script works, but my 'laser' doesn't work very good.
It's alsmost invisible, doesn't act as a laser, and the FPS drops from 400 to 14...

Can someone please give me a realistic example for a laser?
It's oke if it's just a generated WDL from Easy Particle 3.


The best games are the games you create yourself.
Re: Particle ploblem in Lite-C [Re: NL_3DGS_n00b] #213259
06/26/08 16:02
06/26/08 16:02
Joined: Jul 2005
Posts: 262
Earth, The Netherlands
NL_3DGS_n00b Offline OP
Member
NL_3DGS_n00b  Offline OP
Member

Joined: Jul 2005
Posts: 262
Earth, The Netherlands
Anyone who can help me please?
Realy want a realistic laser beam, (for security area's in my test project, and as pistol pointer.


The best games are the games you create yourself.
Re: Particle ploblem in Lite-C [Re: NL_3DGS_n00b] #213981
07/01/08 18:49
07/01/08 18:49
Joined: Dec 2006
Posts: 78
Nevada, USA
Futurulus Offline
Junior Member
Futurulus  Offline
Junior Member

Joined: Dec 2006
Posts: 78
Nevada, USA
Code:
function lazerAspezial()
{
   // ...
   // I know it's p.gravity = 0 and p.flags = BRIGHT | MOVE now, but I'll use the original for clarity.
   my.alpha = 21.738 ;
   my.gravity = 0 ;
   my.streak = off;
   my.flare = off;
   my.bright = on;
   my.beam = off;
   my.move = on;
   // ...
}

I think the "almost invisible" part comes from this line: my.alpha = 21.738;.
EasyParticle may fool you into thinking that looks good, but 22% is not very visible.

Also, you say it "doesn't act as a laser"... from what I understand, this effect shoots sort of a ball of energy at a random speed along the x-axis. There are a few problems with this. Number one, the laser can't be aimed at all. If you're making a side-scroller where a player can only shoot along the x-axis, this won't be a problem, but it seems like you're making a first person shooter. And number two, if you don't make enough particles (right now you're only making a max of one per frame) the balls of energy won't be numerous enough to fuse into a beam. Making more particles could also fix the "invisible" problem.

Good luck!

Re: Particle ploblem in Lite-C [Re: Futurulus] #213990
07/01/08 19:29
07/01/08 19:29
Joined: Jul 2005
Posts: 262
Earth, The Netherlands
NL_3DGS_n00b Offline OP
Member
NL_3DGS_n00b  Offline OP
Member

Joined: Jul 2005
Posts: 262
Earth, The Netherlands
Could you make an EasyParticle example for this?
I cant get it right...


The best games are the games you create yourself.
Re: Particle ploblem in Lite-C [Re: NL_3DGS_n00b] #214020
07/02/08 02:31
07/02/08 02:31
Joined: Dec 2006
Posts: 78
Nevada, USA
Futurulus Offline
Junior Member
Futurulus  Offline
Junior Member

Joined: Dec 2006
Posts: 78
Nevada, USA
I don't actually know much about EasyParticle ... do you think you could post a screenshot of what it looks like in the test project? It might help in determining what's wrong.

For the alpha thing, chances are EasyParticle has an option called 'alpha', 'transparency', 'opacity', or something of the sort. Try setting it to a more opaque value. I may be totally wrong, though.


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