0 registered members (),
1,397
guests, and 7
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Script help: Push a crate
[Re: Al_Meyer]
#203541
04/22/08 17:35
04/22/08 17:35
|
Joined: Oct 2007
Posts: 42 Minnesota, USA
Techd
Newbie
|
Newbie
Joined: Oct 2007
Posts: 42
Minnesota, USA
|
Start with this:) define scan_mode,skill1;
define speed_x,skill2;
define speed_y,skill3;
define scan_pushable,987.654; // a unique number
function push_me();
action push_able
{
my.scan_mode = scan_pushable;
my.enable_impact = on;
my.event = push_me;
}
function push_me()
{
if(!you) {return;}
if(you.z > my.z+my.max_z){return;}
if(you.scan_mode == scan_pushable)
{
my.speed_x = you.speed_x;
my.speed_y = you.speed_y;
}
else
{
my.speed_x = fcos(you.pan,5*0.9*time);
my.speed_y = fsin(you.pan,5*0.9*time);
}
move_mode = ignore_passable+glide;
ent_move(nullvector,vector(my.speed_x,my.speed_y,0));
}
Life is what you make it just like Games!
|
|
|
Re: Script help: Push a crate
[Re: Al_Meyer]
#203604
04/23/08 01:09
04/23/08 01:09
|
Joined: Oct 2007
Posts: 42 Minnesota, USA
Techd
Newbie
|
Newbie
Joined: Oct 2007
Posts: 42
Minnesota, USA
|
You should define all variables at the top of your level.wdl(define scan_mode,skill1;) Then put your Function first function push_me()
{
if(!you) {return;}
if(you.z > my.z+my.max_z){return;}
if(you.scan_mode == scan_pushable)
{
my.speed_x = you.speed_x;
my.speed_y = you.speed_y;
}
else
{
my.speed_x = fcos(you.pan,5*0.9*time);
my.speed_y = fsin(you.pan,5*0.9*time);
}
move_mode = ignore_passable+glide;
ent_move(nullvector,vector(my.speed_x,my.speed_y,0));
}
} Then Your Action action push_able
{
my.scan_mode = scan_pushable;
my.enable_impact = on;
my.event = push_me;
} this worked for me, but I put the code in a separate wdl(pushable.wdl) and included in my level.wdl(include <pushable.wdl>;) Hopes this help! also if you paste the code as is put another } at the end of function push_me()
Life is what you make it just like Games!
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|