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
Accensus
Banned User
Posts: 2383
Joined: Thu Feb 11, 2016 9:59 am

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

Post by Accensus »

Much better. Many thanks, you guys!
User avatar
CJacobsSA
Posts: 62
Joined: Mon May 30, 2016 10:01 pm

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

Post by CJacobsSA »

LogicalFallacy wrote: What I would do for the line is define a universal integer (so outside any scripts) and have the necessary script increment the integer. Then you can have the line's script check if the integer has been incremented and end itself without doing anything if it hasn't.
Example:

Code: Select all

int test = 0;
script "prereq" (void)
{
//stuff this script does;
test++;
}
script "LineTeleport" (void)
{
if (test == 1)
{
Teleport(/*You know what goes here.*/)
}
}
Gez wrote: Not a compatmode, but you can set [wiki]compatibility options[/wiki] in MAPINFO, yes. For instance, if you want things to be infinitely vertical for collisions, add that line in the map definition.

Code: Select all

compat_nopassover
Inversely, if you want to make sure it is off, use this line:

Code: Select all

compat_nopassover = 0
IIRC that should work.
Thank you, I'll give that a try! :D
User avatar
SigFloyd
Posts: 163
Joined: Mon Feb 13, 2012 2:03 am

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

Post by SigFloyd »

Is there any way to have a projectile with the +BLOODSPLATTER flag always spawn blood? As it is, it only does so 2/3rds of the time, and having the projectile directly spawn its own blood using A_SpawnItemEX doesn't take the monster's blood color into account.
D2JK
Posts: 545
Joined: Sat Aug 30, 2014 8:21 am

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

Post by D2JK »

I'm trying to use the actor state for-loop for the first time:

Code: Select all

Fire:
 TNT1 A 0
  {
   for (  A_SetUserVar(user_i, 0); user_i < 360; A_SetUserVar(user_i, user_i + 45)  )
    {
     A_FireBullets ( user_i, user_i, -1, 10);
    }
  }
 ...
This sometimes freezes the game (with loads of ricochet sounds coming from the bullet puff actor), and sometimes simply produces no shots fired. What am I doing wrong? I have written "var int user_i;" in the weapon definition.
User avatar
worldendDominator
Posts: 291
Joined: Sun May 17, 2015 9:39 am

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

Post by worldendDominator »

First argument of A_SetUserVar is a string containing uservar name, so you need to put it in quotes.
D2JK
Posts: 545
Joined: Sat Aug 30, 2014 8:21 am

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

Post by D2JK »

Someone should correct that in the wiki (the for-loop section in actor states - page).

And unfortunately, that didn't solve the problem. But I managed to create another test case where the freeze doesn't occur, so I was able to read an error message:

"VM execution aborted: invalid self pointer".
User avatar
worldendDominator
Posts: 291
Joined: Sun May 17, 2015 9:39 am

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

Post by worldendDominator »

What are you trying to do, in the first place? Shoot 8 bullets with increasing spread?

Also, does that freeze/crash happen if you do it via a state loop rather than anonymous function?
D2JK
Posts: 545
Joined: Sat Aug 30, 2014 8:21 am

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

Post by D2JK »

No, I'm just simplifying my manual circular pattern code, replacing it by the use of sin/cos expressions along with FBF_EXPLICITANGLE flag.

Well, the state loop you suggested crashed as well, but I found the cause; for some reason the user variable wasn't incrementing properly (or maybe there's some sort of upper limit I've forgotten), so it never reached the end condition. This, coupled with zero-tic duration of the looped action produced the freeze, of course.

So I switched to args, and it worked like a charm right off the bat:

Code: Select all

for (A_SetArg(4, 0); args[4] < 360; A_SetArg(4, args[4] + 45))
Blue Shadow
Posts: 5046
Joined: Sun Nov 14, 2010 12:59 am

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

Post by Blue Shadow »

The issue you're having is this: http://forum.zdoom.org/viewtopic.php?f=7&t=53361
User avatar
adamaH_oriH
Posts: 327
Joined: Thu Jul 23, 2015 8:10 am
Location: Mars Base

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

Post by adamaH_oriH »

Hey, I have two customdeaths for the player using 2 'NewDoomPlayer's

whenever Hiro get's killed by an imp,

this happens:

KEYCONF:

Code: Select all

clearplayerclasses
addplayerclass NewDoomPlayer1
DECORATE:

Code: Select all

ACTOR NewDoomPlayer1 : DoomPlayer replaces DoomPlayer
{
+NOSKIN
States
  {
  Death.DalekBall:
    LASD A 3 bright
	PLAY G 2 A_PlayerScream
	LASD A 3 bright
	PLAY G 2
	LASD A 3 bright
	PLAY G 2
	LASD A 3 bright
	PLAY G 2
    PLAY H 10
    PLAY I 10
    PLAY J 10 A_NoBlocking
    PLAY KLM 10
    PLAY N -1
    Stop
	}
}
and when Hiro get's killed by Vader's lightsaber...

KEYCONDEF:

Code: Select all

clearplayerclasses
addplayerclass NewDoomPlayer2
DECORATE:

Code: Select all

ACTOR NewDoomPlayer2 : DoomPlayer replaces DoomPlayer
{
+NOSKIN
States
  {
  Death.VaderMelee:
	PLVD A 2 A_PlaySound ("player/vaderkillmelee")
	PLVD B 0 A_SpawnItemEx("HiroHead", 0, 0, 40, random(2,4), random(2,4), random(2,4), random(0,360), 161)
	PLVD B 14 bright
    PLVD C 8
    PLVD D 8
    PLVD E 8
    PLVD F 8 A_NoBlocking
	PLVD GG 8
    PLVD G -1
    Stop
	}
}

Actor HiroHead
{
  Radius 11
  Height 11
  Speed 0
  Damage 0
  Projectile
  BounceType "Doom"
  -NOGRAVITY
  +DOOMBOUNCE
  +BOUNCEONACTORS
  States
  {
  Spawn:
    HHHD ABCDEFGH 4
    loop
  Death:
    HHHD I -1
    stop
  }
}
NOW... Here's the problem...

when I inserted Vadder death code, the dalek death code would not work.

I figured it had to do with the KEYCONF, so I tried two things:

1. Put

Code: Select all

clearplayerclasses
addplayerclass NewDoomPlayer1
and

Code: Select all

clearplayerclasses
addplayerclass NewDoomPlayer2
in the same KEYCONF Text File.

AND

2.

put

Code: Select all

clearplayerclasses
addplayerclass NewDoomPlayer1
AND

Code: Select all

clearplayerclasses
addplayerclass NewDoomPlayer2
in Two different KEYCONF text files.

Neither gave any Avail, mostly, the 'NewDoomplayer1' Dalek Death would not be in the game, but the Vader one would. What's Happening?
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

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

Post by wildweasel »

Please upload a WAD file for us to look at. Your instructions are not enough to reproduce the problem.
User avatar
adamaH_oriH
Posts: 327
Joined: Thu Jul 23, 2015 8:10 am
Location: Mars Base

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

Post by adamaH_oriH »

wildweasel wrote:Please upload a WAD file for us to look at. Your instructions are not enough to reproduce the problem.
I'm only going to give you the main problem part, the main wad file is, well... let's just say...

HUGE...

First off, how do I send a file through Dropbox?

second, when you get the wad file, the two KEYCONFs are in the same text file.

try that, make sure you will not get a 'select class' menu

if that happens, try splitting the KEYCONFs of NewDoomPlayer1 and NewDoomPlayer2 into two different KEYCONF text files.
User avatar
jpalomo
Posts: 772
Joined: Mon May 17, 2010 9:45 am

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

Post by jpalomo »

I'd avoid using KEYCONF to add your player classes. Mapinfo is the way to go. As for your extra death states, why not place them in the same actor?
User avatar
arookas
Posts: 265
Joined: Mon Jan 24, 2011 6:04 pm
Contact:

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

Post by arookas »

Would the problem be that you're putting each new death animation in its own player class? The player can only be one player class at a time. Try putting both death states in the same player class.
User avatar
adamaH_oriH
Posts: 327
Joined: Thu Jul 23, 2015 8:10 am
Location: Mars Base

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

Post by adamaH_oriH »

jpalomo wrote:I'd avoid using KEYCONF to add your player classes. Mapinfo is the way to go. As for your extra death states, why not place them in the same actor?
How do I use it in MAPINFO? Put them in the same Actor?
Arookas wrote:Would the problem be that you're putting each new death animation in its own player class? The player can only be one player class at a time. Try putting both death states in the same player class.
that's what I'm trying to do, put both death states in the same player, whenever Hiro gets killed by a certian attack, it has it's own death animation (Like BD has different death states.) Also, what do you mean by putting it in it's own player class?

I would lend you the WAD that has the problem, but It's a bit big. (two monsters, 1 player)
Locked

Return to “Editing (Archive)”