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.

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

Postby SoundOfDarkness » Mon Oct 23, 2017 4:40 am

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
SoundOfDarkness
Offering translation help for Wolfenstein based mods
 
Joined: 28 Feb 2017
Location: at home

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

Postby Mav3r1ck » Mon Oct 23, 2017 6:35 am

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
Mav3r1ck
 
Joined: 17 Jul 2015

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

Postby MetallicaSepultura » Mon Oct 23, 2017 9:14 am

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

//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
MetallicaSepultura
Taking the Angst, setting Revenge
 
Joined: 15 May 2016
Location: Futura City, currently slaughtering Rahzs

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

Postby Apeirogon » Mon Oct 23, 2017 11:12 am

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
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

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

Postby MetallicaSepultura » Tue Oct 24, 2017 4:44 am

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 allExpand view
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
 }
}
User avatar
MetallicaSepultura
Taking the Angst, setting Revenge
 
Joined: 15 May 2016
Location: Futura City, currently slaughtering Rahzs

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

Postby Blue Shadow » Tue Oct 24, 2017 5:42 am

You cannot use Goto inside anonymous functions.
User avatar
Blue Shadow
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD (Modern GZDoom)

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

Postby MetallicaSepultura » Tue Oct 24, 2017 6:45 am

Blue Shadow wrote:You cannot use Goto inside anonymous functions.

tried to change the code without using Goto inside function, still doesn't work.
Code: Select allExpand view
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
 }
}
User avatar
MetallicaSepultura
Taking the Angst, setting Revenge
 
Joined: 15 May 2016
Location: Futura City, currently slaughtering Rahzs

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

Postby DnB-Freak » Tue Oct 24, 2017 7:13 am

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.
DnB-Freak
Drum and Bass in ya face
 
Joined: 19 May 2013

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

Postby Apeirogon » Tue Oct 24, 2017 7:45 am

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
I have a strange sense of humour
 
Joined: 12 Jun 2017

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

Postby Apeirogon » Tue Oct 24, 2017 7:49 am

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.
User avatar
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

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

Postby DnB-Freak » Tue Oct 24, 2017 10:38 am

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
Drum and Bass in ya face
 
Joined: 19 May 2013

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

Postby DnB-Freak » Tue Oct 24, 2017 10:46 am

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 allExpand view
Wander:
  NAME A 0 A_SetAngle(angle)
  NAME A 4 A_Wander(CHF_NODIRECTIONTURN)


if I understood your request right...
DnB-Freak
Drum and Bass in ya face
 
Joined: 19 May 2013

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

Postby Blue Shadow » Wed Oct 25, 2017 12:50 am

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
Blue Shadow
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD (Modern GZDoom)

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

Postby MetallicaSepultura » Wed Oct 25, 2017 12:52 am

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 allExpand view
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.
User avatar
MetallicaSepultura
Taking the Angst, setting Revenge
 
Joined: 15 May 2016
Location: Futura City, currently slaughtering Rahzs

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

Postby Blue Shadow » Wed Oct 25, 2017 12:58 am

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.
User avatar
Blue Shadow
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD (Modern GZDoom)

PreviousNext

Return to Editing (Archive)

Who is online

Users browsing this forum: ShallowB and 2 guests