A Christmas present for ZDoom

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: A Christmas present for ZDoom

by TheDarkArchon » Mon Nov 28, 2005 5:13 am

From experience, it cancels.

by DoomRater » Sun Nov 27, 2005 4:15 pm

Graf Zahl wrote:I needed some handling for states which jump to themselves anyway so I just used that to signal failure. And to make it more intuitive I added 'FAIL' as a synonym for 'WAIT'.


Now you can do:

Code: Select all

ACTOR MagicThingy : Inventory
{
+INVBAR
Inventory.MaxAmount 1
states
	{
	Spawn:
		RKEY A 4
		BKEY A 4
		YKEY A 4
		loop
	Use:
		RKEY A 1 A_JumpIfInventory("Mana1", 10, 2)
		RKEY A 1 A_PlaySound("*usefail")
		Fail
		RKEY A 1 A_TakeInventory("Mana1", 10)
		RKEY A 1 HealThing(5)
		Fail
	}
}
and the item will stay.
Sorry to bump the topic but I think I need clarification. You said the Fail state basically calls itself? Does that mean that when it hits the Fail State it just waits there until the condition is met? Or does it actually cancel? I'm guessing it exits the loop without removing the item, similar to stop.

By the way cool inventory item concept.

by Graf Zahl » Mon Jun 13, 2005 2:20 am

I'll take a look. It worked when I tested the code after writing it.

by Anakin S. » Sun Jun 12, 2005 10:56 pm

It seems like A_JumpIfCloser doesn't work for weapons, even after Graf added the code. It crashes. Maybe there's something I'm doing wrong. Has anyone else tried A_JumpIfCloser for weapons? The Goto Select lines don't crash it. It crashes at the FHMR B frame, which is where A_JumpIfCloser is used.

Code: Select all

ACTOR HammerOfRetribution : FWeapHammer
{
   	Fire:
	Hold:
		FHMR B 6
		FHMR C 0 A_JumpIfCloser(48, 6)
		FHFX S 0 A_PlaySound("FighterHammerMiss")
		FHMR CD 3
		FHMR E 2
		FHMR E 10 A_FireCustomMissile("HammerShot")
		Goto Select

      		FHMR C 3 A_FireBullets(2, 2, 1, 10, "NewHammerPuff", 1)
		FHMR D 3
		FHMR E 2
		FHMR E 10
      		Goto Select
   	}
} 

by Daniel » Tue Jun 07, 2005 11:13 am

AAAhHHH!!! So maybe this can fix the bug we were talking about on "Updated ZDGuns" forum... I'll try this one.

Thanks Graf, we enjoy your work. We can't do all the stuff we wish, we have lives to go on...


I've tried using Fail, but when we use this funcion, the engine always says something like "invalid state parameter" or something...

Well, seems to be that Grubber's exe (before today's version) doesn't support the Fail command; the engine thinks it's an Sprite name :?

by Graf Zahl » Tue Jun 07, 2005 8:42 am

Daniel wrote:I think it is; it it wasn't, the engine would say "Bad command on line xxx"... but I don't know the function of Fail. So, keep using Stop.

The difference is that 'Fail' signifies failed use (or pickup) so the item doesn't get removed.

And sorry for the delay of this stuff. I was extremely busy with other stuff over the weekend so it will be in the next update (hopefully next Saturday.)

by Daniel » Tue Jun 07, 2005 7:29 am

I think it is; it it wasn't, the engine would say "Bad command on line xxx"... but I don't know the function of Fail. So, keep using Stop.

by Anakin S. » Mon Jun 06, 2005 11:40 pm

Thanks. I thought that Fail was already included in Grubber's most recent build. I guess I have to just use Stop for now.

by Daniel » Mon Jun 06, 2005 11:27 pm

That's the "Fail". You must use "Stop" instead of it.

by Anakin S. » Mon Jun 06, 2005 11:07 pm

Code: Select all

ACTOR ShotgunPickup : Inventory 2001
{
	States
	{
	Spawn:
		SHOT A -1
		Stop
	Pickup:
//		TNT1 A 0 A_TakeInventory("ShotgunPickup", 1)
		TNT1 A 0 A_JumpIfInventory("UpgradedShotgun", 1, 2)
		TNT1 A 0 A_GiveInventory("NewShotgun1", 1)
		Fail
---->		TNT1 A 0 A_GiveInventory("Shell", 8)
		Fail
	}
	+AUTOACTIVATE
	Inventory.Amount 1
	Inventory.MaxAmount 100
	Inventory.PickupSound "misc/w_pkup"
	Inventory.PickupMessage "You got the shotgun!"
}

ACTOR ShotgunUpgrade : Inventory 3421
{
	States
	{
	Spawn:
		SHUP A -1
		Stop
	Pickup:
		TNT1 A 0 A_TakeInventory("NewShotgun1", 1)
		TNT1 A 0 A_GiveInventory("UpgradedShotgun", 1)
		Fail
	}
	+AUTOACTIVATE
	Inventory.Amount 1
	Inventory.MaxAmount 100
	Inventory.PickupSound "misc/w_pkup"
	Inventory.PickupMessage "You got the sawed-off shotgun!"
}
This piece of code crashes zdoom with a message referring to the line the arrow points to, saying:
SC_GetNumber: Bad numeric constant "A".
Does anyone know what I might be doing wrong here? It also says there's something wrong with "Inventory.Amount" and "+". :?

by Daniel » Mon Jun 06, 2005 9:48 pm

No, I think it woudn't change. It's like to use the railgun; it doesn't have autoaim, and it wouldn't make difference into the autoaim and the noautoaim mode.

Sorry, I meant +NOAUTOAIM. +AUTOAIM is useless, because it's set by a player value.

by HobbsTiger1 » Mon Jun 06, 2005 9:44 pm

Wouldn't +AUTOAIM cause problems for those who don't use autoaim?

by Daniel » Mon Jun 06, 2005 9:42 pm

Hehehe... not problems with english, but problems with my head :lol:


So what is the point here:

1 - The high-speed projectile missing the target is a bug, like the projectile bug that makes more than 1000 points of damage and kills the player even on invulnerability;

2 - +NOAUTOAIM could be an useful flag, to make weapons that shot grenades, flames or even flying ghosts - this kind of shot doesn't need to target at the enemy. But it makes only ONE weapon without aim, it doesn't change the "Autoaim value" for the player.

3 - I'll try to explain better what I mean, I hope.

by DoomRater » Mon Jun 06, 2005 9:39 pm

I usually correct that myself, using an alias command that turns off autoaim and then turns on mouselook. When I'm don it resets autoaim to always and turns off mouselook.

by HobbsTiger1 » Mon Jun 06, 2005 9:38 pm

Not only that, but what you said was very confusing.

EDIT: Why wouldn't we use the skulltag style for that (grenade launcher). Works fine if you ask me.

Top