Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
4 registered members (AndrewAMD, dBc, clonman, TipmyPip), 18,735 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
preloading bitmap data #288085
09/04/09 04:35
09/04/09 04:35
Joined: Mar 2009
Posts: 276
Cebu City, Philippines
boyax Offline OP
Member
boyax  Offline OP
Member

Joined: Mar 2009
Posts: 276
Cebu City, Philippines
Hi,

I've encounter some problem with my particle effects. The first time I would hit my bottle points object then, play some particle effects the bitmap stucked for a second then it would play the sprite animation bitmap. I believe the sprite animation bitmap should be loaded first in the memory.. but I don't know how to??

Here's some code snippet:
bottlePts.c
Code:
STRING* bmp_waterExplosion = "WaterExplode+12.tga";

//--------------------------------------------------------------------
// Action: Bottle 50 pts.
//--------------------------------------------------------------------
action act_botle50pts()
{   
  var bottle_animpercent = 0;   
  my.IDBottle = 1;
  set(my, POLYGON | LIGHT);
  my.emask = ENABLE_IMPACT;
  my.event = event_bottle;
  ...   
}

//--------------------------------------------------------------------
// Event: event_bottle
//--------------------------------------------------------------------
function event_bottle()
{   
  VECTOR tempV;    
  VECTOR vecTemp;
  var tempSec = 0;
  var tempCorrSec = 0;
   
  if(EVENT_IMPACT == event_type)
  {
    ....                           
    ent_createlocal(bmp_waterExplosion, my.x, WaterExplosionEffect);
    ent_remove(my);  //remove bottle                       
  }       
}



I'm looking also with the functions:
bmap_preload(bmap) - but I'm not sure how would I convert from BMAP* to String*.
ent_preload(Entity*)- this should be done probably in the main script but the entity should be created in the event in which I could play the entity function for effects

argh! I'm still confused.... Any advised how should I do it?
Thanks

Re: preloading bitmap data [Re: boyax] #288099
09/04/09 08:32
09/04/09 08:32
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
bmap_preload wont work for entities. You must use ent_preload, do that once when you load the level and afterwards your entities will be created fast. Otherwise it's a disk access and of course slow the first time.

Re: preloading bitmap data [Re: Spirit] #288103
09/04/09 09:07
09/04/09 09:07
Joined: Mar 2009
Posts: 276
Cebu City, Philippines
boyax Offline OP
Member
boyax  Offline OP
Member

Joined: Mar 2009
Posts: 276
Cebu City, Philippines
Thanks Spirit. I've already solved this one.
You're right, I just use the ent_preload.


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

Gamestudio download | 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