Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Darkforce002

Pain Elemental question [decorate]

Recommended Posts

Im trying to get the custom A_painAttack option to work
but every time I try that; Skulltag, Zdoom, and GZdoom say:

Script error, "Ele.pk3:decorate.txt" line 9:
Sprite names must be exactly 4 characters

ACTOR BaronEle : PainElemental
{
	States
	{
	Missile:
		PAIN D 5 A_FaceTarget
		PAIN E 5 A_FaceTarget
		PAIN F 4 BRIGHT A_FaceTarget
		PAIN F 1 BRIGHT A_PainAttack ["Baronball"]
		Goto See
	}
}

Share this post


Link to post

On AZERTY keyboards parentheses are one keystroke and brackets two. The only sensical choice is obvious: everyone should just adopt french as the international language!

Share this post


Link to post

that worked instead of "A_PainAttack ["Baronball"]", I used "A_PainAttack(Baronball)" (without the quotes) which seems a bit misleading if you looked at the ZDoom Wiki which says "A_PainAttack [(String type)]", and for some odd reason the baron ball that the Pain elemental fires sometimes sticks to walls, floors, and ceilings :confused: .

Share this post


Link to post

The brackets signify if a parameter is optional, whereas if you used the A_PainAttack by itself without an actor to shoot, it would by default spawn a lost soul.

EDIT: Also, you're using a bad function for spawning projectiles, A_PainAttack is meant to spawn another monster, and when it does the actor it spawns calls A_SkullAttack. Since the BaronBall is already a projectile, the A_SkullAttack function might cause it to have some undefined behavior. Try using A_CustomMissile instead.

Share this post


Link to post
Rayzik said:

EDIT: Also, you're using a bad function for spawning projectiles, A_PainAttack is meant to spawn another monster, and when it does the actor it spawns calls A_SkullAttack. Since the BaronBall is already a projectile, the A_SkullAttack function might cause it to have some undefined behavior. Try using A_CustomMissile instead.


I know that I was just testing the a_painattack function for a mod (the monster won't be using baronball or any non-monster projectile.)

Share this post


Link to post
Rayzik said:

The brackets signify if a parameter is optional, whereas if you used the A_PainAttack by itself without an actor to shoot, it would by default spawn a lost soul.


Exactly. The brackets mean you can use A_PainAttack by its lonesome, or A_PainAttack("someactor"). Likewise, some of the functions have optional parameters and non-optional ones. So it could look like this:
A_DoSomething(param1, param2[, param3[, param4]])

That means that it can be either:
A_DoSomething(param1, param2)
or:
A_DoSomething(param1, param2, param3)
or:
A_DoSomething(param1, param2, param3, param4)

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×