//this is the enemy decorate
actor Mitragliere 15003{
radius 20
Monster
height 56
health 1
scale 2
+FLOORCLIP
States{
Spawn:
SEPM A 0
SEPM A 0 acs_executealways(5,0)
Goto See
See:
SEPM AB 4
Loop
Missile:
SEPM AB 1
Goto Spawn
Melee:
SEPM AB 1 BRIGHT
Goto Missile
Death:
SEPM C 20
stop
}
}
//and this is the momement script he uses
script 5 (void)
{
do
{
setactorposition(0,getactorx(0),getactory(0)-4.0,0.0,0);
delay(1);
}
while (getactory(0)>getactorY(16));
}
actor Mitragliere 15003{
radius 20
var int user_distance;
Monster
height 56
health 1
scale 2
+FLOORCLIP
States{
Spawn:
SEPM A 0
{
user_distance = 56;
}
SEPM A 0 acs_executealways(5,0)
Goto See
See:
SEPM AB 4
{
if (user_distance<=0){
Goto Melee
}
else{
user_distance--;
}
}
Loop
Missile:
SEPM AB 1
Goto Spawn
Melee:
SEPM AB 1 BRIGHT a_custommissile("ProiettileAntiRivolta",24,0,0,cmf_aimdirection,0)
Goto Missile
Death:
TNT1 A 0 a_spawnitem("AntiBarricataMorto",0,24)
stop
}
}
Blue Shadow wrote:You cannot use Goto inside anonymous functions.
States{
Spawn:
SEPM A 0
{
user_distance = 56;
}
SEPM A 0 acs_executealways(5,0)
Goto See
See:
SEPM AB 4
{
if (user_distance<=0){
a_custommissile("ProiettileAntiRivolta",24,0,0,cmf_aimdirection,0);
}
else{
user_distance--;
}
}
Loop
Missile:
SEPM AB 1
Goto Spawn
Melee:
Goto Missile
Death:
TNT1 A 0 a_spawnitem("AntiBarricataMorto",0,24)
stop
}
}
Chickenlegz wrote:May I ask one simple question?
I dunno if the anonymous functions are needed to fix this, but...
How do I set an actor Angle and Pitch to match sloped floor surface normals?
(an actor Z axis have to face the normal(the floor) whenever its sloped or not)
It's not very easy to me as I'm just a beginner in ZScripts,
but I'm sure this has been fixed before under different tags.
Setting an actor's Up to sector surface normal.
Apeirogon wrote:
There are somewhere
viewtopic.php?p=973384#p973384
Or just ask cooke, if it has not yet arrived at hawaii.
Apeirogon wrote:How make a_wander function more offen change direction of wandering?
I try angle actor with a_setangle, but that only make monster sprite spin "like record baby, round round, round round..." and dont change direction of wandering.
Wander:
NAME A 0 A_SetAngle(angle)
NAME A 4 A_Wander(CHF_NODIRECTIONTURN)
MetallicaSepultura wrote:tried to change the code without using Goto inside function, still doesn't work.
Blue Shadow wrote:MetallicaSepultura wrote:tried to change the code without using Goto inside function, still doesn't work.
The error is probably coming from somewhere else not related to that actor, since I didn't get it when testing. Although just to be sure, what version of GZDoom are you using?
See:
SEPM A 4
SEPM A 0 A_SetUserVar("user_distance",user_distance+1)
SEPM A 0 A_JumpIf(user_distance==4,"Missile")
SEPM B 4
Loop
Missile:
SEPM A 1 a_custommissile("ProiettileAntiRivolta",24,0,Random(-7,7),cmf_aimdirection)
SEPM B 1
SEPM A 0 A_PlaySound("MGun/Fire")
SEPM A 4
SEPM A 0 A_SetUserVar("user_distance",0)
Goto See
Users browsing this forum: ShallowB and 2 guests