Most asked questions

Top  Previous  Next

Q: Ok I got the blade code from AUM. Yeah it works, but it doesn't hurt the enemies. Any help would be welcome.
A: You have to replace function kill_player:

 

function kill_player()
{
if (you != null)
{
   you._health = 0;
}
}

Q: I need code that will allow me to click and move a panel on the screen as long as I keep pressed the left mouse button.
A: Here's a working example:

bmap panel_map = <panel.pcx>;
bmap arrow_pcx = <arrow.pcx>;

function move_panel();
function init_mouse();

panel test_pan
{
  bmap = panel_map;
  layer = 20;
  pos_x = 0;
  pos_y = 0;
  flags = d3d, overlay, refresh, visible;
  on_click move_panel;
}

function move_panel()
{
  while (mouse_left == 1)
  {
      test_pan.pos_x = pointer.x;
      test_pan.pos_y = pointer.y;
      wait (1);
  }
}

function init_mouse() // call this function in main
{
  mouse_map = arrow_pcx;
  mouse_mode = 2;
  while (1)
  {
      mouse_pos.x = pointer.x;
      mouse_pos.y = pointer.y;
      wait (1);
  }
}

Q: If you have a text string too big for your panel, will the engine automatically scroll it for you?
A: No, you have to split it in smaller strings (use str_len, str_clip, etc)

 

Q: How can I create a weapon that fires another model made by me?
A: If you are using the templates create a gun that uses FIRE_ROCKET and replace rocket.mdl with your model.

 

Q: I'm having serious trouble with the level_load command. I have created a level that gives information to the player. When the function that displays this information is finished, it loads another level. The level loads, but the origional function (which is called from main) will not reinitiate.
A: Add me = null in your function if you want to be able to execute other instructions in the same function after level_load.

 

Q: I'm trying to replicate a church in Italy. I want to have very clear looking images. I'm getting an error that says the sprite file size is too big for my video card. How can I insert these paintings and windows efficiently?
A: I'd go for smaller sized sprites but if you really want to use big sprites split them in several smaller sprites (256x256 or smaller).

 

Q: Is it possible to have sprites in a compiled map entity? When I compile a map entity with a sprite in it, the sprite just doesn't show up after loading the wmb file.
A: No, it isn't possible. The sprites have to be added to the level just like the wmb entity.

 

Q: How can I use the vbar command?
A: Here's an example (don't forget to check the 3rd person shooter code too):

vbar 608, 26, 15, flash_vbar_map, 0.5, battery2;

and the description of the terms:

vbar position_on_x, position_on_y, lenght_in_pixels, vbar_bitmap, multiplication_factor, variable_that_changes_vbar;

Q: I start a level, add my terrain to it, save my work and build. I get an error: ca'nt read interim file xxx.$$p. What's happening?
A: You need to add at least a block (cube) to your level. Place it below the terain, texture it and build again - it will work.

 

Q: Is it possible to use an animated gif, or any other animated picture file, as a splashmap?
A: No, but you can use an avi file, a sprite with several frames or several panels.