Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (dr_panther, TedMar, AndrewAMD), 986 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 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 | 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