Page 5 of 7 FirstFirst ... 34567 LastLast
Results 41 to 50 of 69

Thread: Code: Particle module or include file plus editor

  1. #41
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: Code: Particle module or include file plus editor

    My problem seems related to some TBEM calling.
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  2. #42
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: Code: Particle module or include file plus editor

    I made more investigations and I think problem is inside TBEM_Run.
    Maybe more functions are using the same TBEM ID. Can it be?
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  3. #43

    Re: Code: Particle module or include file plus editor

    Simone,

    when the rocket hits the asteriod, it isn't neccesary to add another Particle_Process event, as the one from the Particle_Add (smoke) is still alive and so will run further.

    [code=thinbasic]SUB Missile_AI( )
    LOCAL Distance AS DOUBLE
    LOCAL eventId AS LONG
    LOCAL last AS LONG = TBGL_ENTITYGETFREEID( %sScene, %particleFirst ) - 1
    LOCAL eventParticleAdd, eventParticleExplosion AS DWORD
    LOCAL count AS LONG
    GLOBAL Time_explosion AS LONG
    IF TBGL_ENTITYGETUSE( %sScene, %eAsteroid ) = %FALSE THEN
    IF GETTICKCOUNT - Time_Explosion > 10000 THEN
    eventId = TBEM_GETEVENTID( %evt_Particleadd )
    TBEM_DELETEEVENT( eventId )
    Time_Explosion = - 1
    END IF
    END IF
    IF TBGL_ENTITYGETUSE( %sScene, %eAsteroid ) THEN
    Distance = TBGL_ENTITYGETDISTANCE( %sScene, %eAsteroid, %eMissile )
    IF INT( Distance ) = 0 THEN
    TBGL_ENTITYSETUSE( %sScene, %eAsteroid, %false )
    eventId = TBEM_GETEVENTID( %evt_Particleadd )
    TBEM_DELETEEVENT( eventId )
    eventParticleExplosion = TBEM_ADDEVENT( "Particle_Explosion", %evt_ParticleExplosion )
    TBEM_SETREPEAT( eventParticleExplosion, %TRUE, 20 )
    TBEM_ADDTRIGGER( %evt_ParticleExplosion )
    'eventParticleAdd = TBEM_AddEvent("Particle_Process", %evt_ParticleProcess)
    'TBEM_SetRepeat(eventParticleAdd, %TRUE, 20)
    'TBEM_AddTrigger(%evt_ParticleProcess)
    TBGL_ENTITYSETUSE( %sScene, %eMissile, %false )
    Time_Explosion = GETTICKCOUNT
    END IF
    TBGL_ENTITYSETTARGET( %sScene, %eMissile, %eAsteroid )
    TBGL_ENTITYPUSH( %sScene, %eMissile, 0, 0, 21 / framerate )
    END IF
    END SUB[/code]

  4. #44

    Re: Code: Particle module or include file plus editor

    Quote Originally Posted by Eros Olmi
    Hi Simone.

    your script work perfectly here from the particle point of view but on my computer I get a delay of more than 2 secs when the script starts and a delay of about 3 secs when the rocket hits the rock.

    I made a lot of tests to try to understand where the script stay during this delay but not able to understand it.

    Ciao
    Eros
    Hi Eros,

    are you running this in an OS emulation?

  5. #45

    Re: Code: Particle module or include file plus editor

    Hi Mike,

    Thanks for you suggestion

    Ciao,
    Simone
    LapTop Pc: 2GHz Intel Core 2 Duo T7200 • 2GB 533MHz DDR2 RAM • 160GB hard disk • 512MB ATi Mobility Radeon X1600 graphics • Win Vista SP1<br />Desktop Pc: 1.6GHz Intel Core 2&nbsp; • 2GB DDR2 RAM •&nbsp; 1024MB Nvidia GeForce 8800 GT • WinXp&nbsp; SP3

  6. #46
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: Code: Particle module or include file plus editor

    Under OS emulated all is working fine.

    On my real machine it stops for 1 sec at the first TBEM_RUN and later when explosion takes place for the first time. And this also removing the 3 lines you mentioned in previous post.

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  7. #47

    Re: Code: Particle module or include file plus editor

    Mmh? ??? When you add an event, it stores a starttime (GetTickCount). When you call TBEM_RUN, it looks at all active events (which triggers where fired), if there starttime is older then the current time (GetTickcount) of TBEM_RUN. If the trigger is a repeating one, a new starttime is set (Old starttime + trigger_repeattime). So what you have experienced sounds like somehow the starttime is set 2 seconds in the future, same when the explosion starts.

    I uploaded the current sources so you will be able to debug this better if you want.

    Michael

  8. #48
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: Code: Particle module or include file plus editor

    Thank you so much Michael.
    I've already downloaded sources. I will study them this evening when at home.

    In any case, this is happening only on my computer. On other computers this is not happening. So very very strange.

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  9. #49

    Re: Code: Particle module or include file plus editor

    With the sources you can debug it better. Maybe I'm doing something wrong and this way we can catch it. I allready saw two little other buggies, but they are not related to your problem. I would bet one that. So a new version is bound to come anyway.

  10. #50

    Re: Code: Particle module or include file plus editor

    Hi Petr,

    I was thinking how to do a sparks, you think is best to use polygon like point and line and change size and color or use a texture of one spark like Explosion and smoke. (we have to search the best way for do star wars 7) ;D

    Ciao,
    Simone
    LapTop Pc: 2GHz Intel Core 2 Duo T7200 • 2GB 533MHz DDR2 RAM • 160GB hard disk • 512MB ATi Mobility Radeon X1600 graphics • Win Vista SP1<br />Desktop Pc: 1.6GHz Intel Core 2&nbsp; • 2GB DDR2 RAM •&nbsp; 1024MB Nvidia GeForce 8800 GT • WinXp&nbsp; SP3

Page 5 of 7 FirstFirst ... 34567 LastLast

Similar Threads

  1. Code: Gui module or include file
    By Michael Hartlef in forum Code
    Replies: 35
    Last Post: 17-10-2008, 12:13

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •