AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   creating fire (https://forums.alliedmods.net/showthread.php?t=84763)

Speed! 01-31-2009 13:59

creating fire
 
hi, i wanna create fire on the ground. i know how to get coord and all that stuff, but dunno how to create fire like the HL one, and being damaged if being near it
i think its an entity that may be also created by VHE but dunno

AntiBots 01-31-2009 14:03

Re: creating fire
 
You have to use a Sprite... And then You can check players origins and burn Players.

Speed! 01-31-2009 14:10

Re: creating fire
 
Quote:

Originally Posted by AntiBots (Post 753327)
You have to use a Sprite... And then You can check players origins and burn Players.

but how can i use sprites accuaretly?
because it look shitty what i did LOL
im not used to manage with sprites
i'd need some help
edit: for burning players should i use prethink or w00t?

SnoW 01-31-2009 14:53

Re: creating fire
 
Quote:

Originally Posted by Speed! (Post 753333)
but how can i use sprites accuaretly?
because it look shitty what i did LOL
im not used to manage with sprites

So are u suposing that we are starting to code sprite plugin here? The forums are full of sprites, just find one simple and start with it. Then when u get stuck/need help -> post here with the code.

Speed! 01-31-2009 15:06

Re: creating fire
 
Quote:

Originally Posted by SnoW (Post 753359)
So are u suposing that we are starting to code sprite plugin here? The forums are full of sprites, just find one simple and start with it. Then when u get stuck/need help -> post here with the code.

nope
but i want to know how to give the style of HL i mean, sprites are used to follow you (i mean the angle) but i want to superpose them

Dr.G 01-31-2009 16:28

Re: creating fire
 
Hey check this molotov cocktail plugin out http://forums.alliedmods.net/showthr...hlight=molotov


PHP Code:

stock random_fire(Origin[3], ent) {
 new 
range get_pcvar_num(pMlRadius);
 new 
iOrigin[3];
 for (new 
1<= 5i++) {
  
g_g 1;
  
iOrigin[0] = Origin[0] + random_num(-rangerange);
  
iOrigin[1] = Origin[1] + random_num(-rangerange);
  
iOrigin[2] = Origin[2];
  
iOrigin[2] = ground_z(iOriginent);
  while (
get_distance(iOriginOrigin) > range) {
   
g_g++;
 
   
iOrigin[0] = Origin[0] + random_num(-rangerange);
   
iOrigin[1] = Origin[1] + random_num(-rangerange);
   
iOrigin[2] = Origin[2];
   if (
g_g >= ANTI_LAGG) {
    
iOrigin[2] = ground_z(iOriginent1);
   } else {
    
iOrigin[2] = ground_z(iOriginent);
   }
  }
  new 
rand random_num(515);
  
message_begin(MSG_BROADCASTSVC_TEMPENTITY);
  
write_byte(TE_SPRITE);
  
write_coord(iOrigin[0]);
  
write_coord(iOrigin[1]);
  
write_coord(iOrigin[2] + rand 5);
  
write_short(firespr);
  
write_byte(rand);
  
write_byte(100);
  
message_end();
  if (!(
4)) { // Smoke every 4th flame
   
message_begin(MSG_BROADCASTSVC_TEMPENTITY);
   
write_byte(TE_SMOKE);
   
write_coord(iOrigin[0]);
   
write_coord(iOrigin[1]);
   
write_coord(iOrigin[2] + 120);
   
write_short(smokespr[random_num(01)]);
   
write_byte(random_num(1030));
   
write_byte(random_num(1020));
   
message_end();
  }
 }



Speed! 01-31-2009 21:57

Re: creating fire
 
Quote:

Originally Posted by Dr.G (Post 753417)
Hey check this molotov cocktail plugin out http://forums.alliedmods.net/showthr...hlight=molotov


PHP Code:

stock random_fire(Origin[3], ent) {
 new 
range get_pcvar_num(pMlRadius);
 new 
iOrigin[3];
 for (new 
1<= 5i++) {
  
g_g 1;
  
iOrigin[0] = Origin[0] + random_num(-rangerange);
  
iOrigin[1] = Origin[1] + random_num(-rangerange);
  
iOrigin[2] = Origin[2];
  
iOrigin[2] = ground_z(iOriginent);
  while (
get_distance(iOriginOrigin) > range) {
   
g_g++;
 
   
iOrigin[0] = Origin[0] + random_num(-rangerange);
   
iOrigin[1] = Origin[1] + random_num(-rangerange);
   
iOrigin[2] = Origin[2];
   if (
g_g >= ANTI_LAGG) {
    
iOrigin[2] = ground_z(iOriginent1);
   } else {
    
iOrigin[2] = ground_z(iOriginent);
   }
  }
  new 
rand random_num(515);
  
message_begin(MSG_BROADCASTSVC_TEMPENTITY);
  
write_byte(TE_SPRITE);
  
write_coord(iOrigin[0]);
  
write_coord(iOrigin[1]);
  
write_coord(iOrigin[2] + rand 5);
  
write_short(firespr);
  
write_byte(rand);
  
write_byte(100);
  
message_end();
  if (!(
4)) { // Smoke every 4th flame
   
message_begin(MSG_BROADCASTSVC_TEMPENTITY);
   
write_byte(TE_SMOKE);
   
write_coord(iOrigin[0]);
   
write_coord(iOrigin[1]);
   
write_coord(iOrigin[2] + 120);
   
write_short(smokespr[random_num(01)]);
   
write_byte(random_num(1030));
   
write_byte(random_num(1020));
   
message_end();
  }
 }



thanks u very much :D
+karma

Drak 01-31-2009 23:24

Re: creating fire
 
There is TE_FIREFIELD

Speed! 02-01-2009 00:19

Re: creating fire
 
Quote:

Originally Posted by Drak (Post 753571)
There is TE_FIREFIELD

yes! :D, i thought there were something of that
will take a look

EDIT: having some troubles with that

Quote:

#define TE_FIREFIELD 123 // makes a field of fire.
// coord (origin)
// short (radius) (fire is made in a square around origin. -radius, -radius to radius, radius)
// short (modelindex)
// byte (count)
// byte (flags)
// byte (duration (in seconds) * 10) (will be randomized a bit)
//
// to keep network traffic low, this message has associated flags that fit into a byte:
#define TEFIRE_FLAG_ALLFLOAT 1 // all sprites will drift upwards as they animate
#define TEFIRE_FLAG_SOMEFLOAT 2 // some of the sprites will drift upwards. (50% chance)
#define TEFIRE_FLAG_LOOP 4 // if set, sprite plays at 15 fps, otherwise plays at whatever rate stretches the animation over the sprite's duration.
#define TEFIRE_FLAG_ALPHA 8 // if set, sprite is rendered alpha blended at 50% else, opaque
#define TEFIRE_FLAG_PLANAR 16 // if set, all fire sprites have same initial Z instead of randomly filling a cube.
what should be in "model index" :S?

Drak 02-01-2009 00:42

Re: creating fire
 
Code:
new fire public plugin_precache()      fire = precache_model("sprites/fire.spr");
Use 'fire' as your model index.


All times are GMT -4. The time now is 01:43.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.