1 registered members (henrybane),
1,246
guests, and 8
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Scripting problem
[Re: Superku]
#313948
03/04/10 17:08
03/04/10 17:08
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
Expert
|
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
just a little mistake
in the end of the line:
ent_create("zombiek.mdl",vector(0,0,0),attack)
is a ";" missing
-> ent_create("zombiek.mdl",vector(0,0,0),attack);
Kartoffel
POTATO-MAN saves the day! - Random
|
|
|
Re: Scripting problem
[Re: Kartoffel]
#313957
03/04/10 18:21
03/04/10 18:21
|
Joined: Jul 2008
Posts: 1,178 England
MrGuest
Serious User
|
Serious User
Joined: Jul 2008
Posts: 1,178
England
|
You must create the object after the level has loaded...
level_load ("Huis.wmb");
wait (2); // wait until the level is loaded
ent_create("zombiek.mdl",vector(0,0,0),attack)
Otherwise the script will crash! The level_load() function is now executed immediately, instead of one frame delayed. This can lead to a different behavior when your code for some reason relied on a delayed level loading. try
#include <acknex.h>
#include <default.c>
#define walk_percentage skill11
action zombie_bars()
{
while (1)
{
my.walk_percentage += 3 * time_step; // 3 = animation speed for "walk"
ent_animate(me, "attack", my.walk_percentage, ANM_CYCLE); // "walk" animation loop
wait (1);
}
}
function main()
{
video_mode = 7;
level_load ("Huis.wmb");
ent_create("zombiek.mdl",vector(0,0,0), zombie_bars);
camera.z = 120; // choose a convenient height
camera.tilt = -15; // and tilt angle for the camera
}
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|