I made more investigations and I think problem is inside TBEM_Run.
Maybe more functions are using the same TBEM ID. Can it be?
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
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
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]
Hi Eros,Originally Posted by Eros Olmi
are you running this in an OS emulation?
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 • 2GB DDR2 RAM • 1024MB Nvidia GeForce 8800 GT • WinXp SP3
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
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
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
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.
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 • 2GB DDR2 RAM • 1024MB Nvidia GeForce 8800 GT • WinXp SP3
Bookmarks