The "How do I..." Thread

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
User avatar
SoundOfDarkness
Posts: 114
Joined: Tue Feb 28, 2017 5:53 pm
Location: at home

Re: The "How do I..." Thread

Post by SoundOfDarkness »

I have 2 questions.

1. How to make it that a point blank kill with the super shotgun always gibs the enemy?

2. More or less the same for quad damage. I want enemies to gib when killed while quad damage is active. I already realized that adding +EXTREMEDEATH to the powerup doesn't work.
User avatar
Mav3r1ck
Posts: 262
Joined: Thu Jul 16, 2015 11:09 pm

Re: The "How do I..." Thread

Post by Mav3r1ck »

I'm trying to make a PSX style intermission message screen like on the TC. The trouble I'm having is that there appears to be a limit to how many words can go in the sentence with HUDMESSAGE being the thing that actually list the messages. This will result in the words overlapping on the message screen using the HUDMESSAGE.

So my question is. Can I increase the HUDMESSAGE limit?
User avatar
MetallicaSepultura
Posts: 178
Joined: Sun May 15, 2016 3:49 am
Location: Futura City, currently slaughtering Rahzs

Re: The "How do I..." Thread

Post by MetallicaSepultura »

how can i manage to make an enemy move towards a certain distance, and then after reaching it he starts shooting?

Code: Select all


//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));
}

User avatar
Apeirogon
Posts: 1605
Joined: Mon Jun 12, 2017 12:57 am

Re: The "How do I..." Thread

Post by Apeirogon »

https://zdoom.org/wiki/A_SpawnProjectile
with

CMF_AIMDIRECTION - The missile is not aimed at a target. Instead, it is shot in the specified direction with the specified pitch.

or

CMF_ABSOLUTEPITCH - Use the pitch parameter as an absolute value, ignoring the calculated aim pitch. Implied CMF_AIMDIRECTION. The main difference here is that a target is required, where CMF_AIMDIRECTION does not require a target.

because i dont get, you need just shoot somewhere or shoot into player.
User avatar
MetallicaSepultura
Posts: 178
Joined: Sun May 15, 2016 3:49 am
Location: Futura City, currently slaughtering Rahzs

Re: The "How do I..." Thread

Post by MetallicaSepultura »

i've probably found a solution for the enemies moving and after a certain distance shooting.
https://zdoom.org/wiki/User_variable#Conditions
i've used variables in DECORATE, so that when the enemy reaches a certain distance (a counter), he starts shooting

the problem is that when i start the game it always says "the frame must be 4 characters", and i don't know where is the problem in the code.

Code: Select all

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
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

Re: The "How do I..." Thread

Post by Blue Shadow »

You cannot use Goto inside [wiki=Actor_states#Anonymous_functions]anonymous functions[/wiki].
User avatar
MetallicaSepultura
Posts: 178
Joined: Sun May 15, 2016 3:49 am
Location: Futura City, currently slaughtering Rahzs

Re: The "How do I..." Thread

Post by MetallicaSepultura »

Blue Shadow wrote:You cannot use Goto inside [wiki=Actor_states#Anonymous_functions]anonymous functions[/wiki].
tried to change the code without using Goto inside function, still doesn't work.

Code: Select all

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
 }
}
DnB-Freak
Posts: 304
Joined: Sun May 19, 2013 12:09 pm

Re: The "How do I..." Thread

Post by DnB-Freak »

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.
User avatar
Apeirogon
Posts: 1605
Joined: Mon Jun 12, 2017 12:57 am

Re: The "How do I..." Thread

Post by Apeirogon »

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.
User avatar
Apeirogon
Posts: 1605
Joined: Mon Jun 12, 2017 12:57 am

Re: The "How do I..." Thread

Post by Apeirogon »

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.
There are somewhere
viewtopic.php?p=973384#p973384
Or just ask cooke, if it has not yet arrived at hawaii.
DnB-Freak
Posts: 304
Joined: Sun May 19, 2013 12:09 pm

Re: The "How do I..." Thread

Post by DnB-Freak »

Apeirogon wrote:
There are somewhere
viewtopic.php?p=973384#p973384
Or just ask cooke, if it has not yet arrived at hawaii.
Nice, there've got it :idea:
Rachael's alg may work, otherwise I'll ask cooke.

Thanx for link Apeirogon
DnB-Freak
Posts: 304
Joined: Sun May 19, 2013 12:09 pm

Re: The "How do I..." Thread

Post by DnB-Freak »

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.
btw, haven't tested this, but A_SetAngle prior A_Wander with CHF_NODIRECTIONTURN as combi, perhaps it helps.

Code: Select all

Wander:
  NAME A 0 A_SetAngle(angle)
  NAME A 4 A_Wander(CHF_NODIRECTIONTURN)
if I understood your request right...
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

Re: The "How do I..." Thread

Post by Blue Shadow »

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?
User avatar
MetallicaSepultura
Posts: 178
Joined: Sun May 15, 2016 3:49 am
Location: Futura City, currently slaughtering Rahzs

Re: The "How do I..." Thread

Post by MetallicaSepultura »

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?
mhhh, strange.
aniway, i changed the code now with this one:

Code: Select all

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
and it works.
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

Re: The "How do I..." Thread

Post by Blue Shadow »

I think you're using an old version of GZDoom which doesn't support anonymous functions, because I just tried the same code with GZDoom 2.1.1, and it gave me that error.
Locked

Return to “Editing (Archive)”