Q:
How can I make it so that when I touch a cd it will take me to the new
level?
A:
Here's a snippet:
string nextlevel_wmb = <next.wmb>;
function beam_me_up();
action
take_me_there // attach it to the cd
{
my.enable_impact = on;
my.event = beam_me_up;
}
function
beam_me_up()
{
wait (1);
level_load (nextlevel_wmb);
}
Q:
I have the standard version of 3D Gamestudio so I cant import terrain files.
I could use models; is there a way to make my terrain model not passable,
so my player can walk on it?
A:
Make your terrain model passable and create a simple, invisible brush structure
underneath it.
Q:
How do you make actors that have skin animations (a character blinks his
eyes or opens his mouth)?
A:
Create several skins for that actor and add them to the model in Med. Use
this piece of code to animate your character:
action
imtalking
{
while (1)
{
while (I am supposed to talk) // put your stuff here
{
my.skin = 1;
waitt (3);
my.skin = 2;
wait (3)
my.skin = 3;
waitt (3);
}
wait (1);
}
}
Q:
Can someone give me a script that moves an entity using the arrow keys,
but it does not move the camera anywhere?
A:
The easy way is to define a new view and make it visible. Place this line
at the beginning of office.wdl file:
view camera2{ }
and the following lines at the end of the main function:
camera.visible
= off;
camera2.size_x
= screen_size.x;
camera2.size_y
= screen_size.y;
camera2.pos_x
= 0;
camera2.pos_y
= 0;
camera2.visible
= on;
Q:
I need the cursor to change when I scroll over an npc. Can you help?
A:
Here's the code:
bmap
cursor_normal = <normal.pcx>;
bmap
cursor_changed = <changed.pcx>;
function change_cursor();
action
npc
{
my.enable_touch = on;
my.enable_release = on;
my.event = change_cursor;
}
function
change_cursor()
{
wait (1);
while (event_type == event_touch)
{
mouse_map = cursor_changed;
wait (1);
}
while (event_type == event_release)
{
mouse_map = cursor_normal;
wait (1);
}
}
Q:
I use the "pathcamera" code in Aum6. I need to stop the camera when it
reaches the last point in the path.How do I do that?
A:
Measure the coords xyz for the last path and then replace while (1) in
cutcam.wdl with:
while (my.x < x_coord && my.y < y_coord && my.z > z_coord)
Please
note that you might need to replace < with > and > cu < depending
on your path.
Q:
I'd like to keep the bullet hole marks on the walls - is it possible?
A:
First of all, change this line in weapons.wdl:
DEFINE kMaxBulletHole 100; -> DEFINE kMaxBulletHole 1000; // 1000 bullet holes now
Replace function bullet_hole() with this one:
function
bullet_hole()
{
// check for maximum bullet holes at any time
if(bullet_hole_index >= kMaxBulletHole)
{
bullet_hole_index = 0;
}
// check to see if its already in use
temp = h_bullet_hole_array[bullet_hole_index];
if(temp != 0)
{
// remove old hole
p_bullet_hole_temp = ptr_for_handle(temp);
remove(p_bullet_hole_temp);
}
// assign this as the new value in the array
h_bullet_hole_array[bullet_hole_index] = handle(me);
my.skill4 = bullet_hole_index; // save index for removal
bullet_hole_index += 1; // increament index
my.transparent = on;
my.flare = on;
my.passable = on;
my.oriented = on;
vec_to_angle(my.pan,normal); // rotate to target normal
}
Q:
I have a few models and I need them to walk using the walk frames; I also
have a character that has a "stand still" animation. Do you have some code?
A:
Look at the enemy_fight action in this AUM edition - the code includes
walking, standing still, attacking and dieing.
Q:
How do you check if the player has entered a certain street?
A:
Get the x and y coords (min and max) for the street in Wed and compare
these values with player's position:
function
street_checker() // start it in main
{
while (1)
{
if (player.x > street_min_x && player.x < street_max_x &&
player.y > street_min_y && player.y < street_max_y)
{
// the player has entered the street
// add your code here
}
else
{
// the player is outside the street
// add your code here
}
wait (1);
}
}