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.
Nevander
Posts: 2254
Joined: Mon Jan 06, 2014 11:32 pm

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

Post by Nevander »

HazeBandicoot wrote:What Textures YScale value should I use to avoid the 20% pixel ratio for a single graphic?
I'd love to know this too so I can void the 20% "adjustment" and keep the graphics and sprites as they appear in the source.

Just a guess, but maybe YScale 1.2 would do it?

EDIT: This worked for me, the offsets of course will change but this is the concept. I had to add 34 more to the Y offset to get the weapon to be at the bottom of the screen if you are not using a standard status bar.

Code: Select all

Sprite PISGA0, 56, 87
{
	YScale 1.2
	Offset -125, -115
	Patch PISGA0, 0, 0
}
User avatar
YukiHerz
Global Moderator
Posts: 1503
Joined: Mon Dec 02, 2013 6:01 pm
Graphics Processor: Intel (Modern GZDoom)
Location: Where corruption is redefined daily.

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

Post by YukiHerz »

Thanks, that works.
User avatar
Alekv
Posts: 170
Joined: Mon Jun 08, 2015 12:41 am
Location: My world :)
Contact:

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

Post by Alekv »

Tell me, what is the probability that KEYSONF add if{..}?
Like this:

Code: Select all

AddMenuKey "Jump" +JumpUp
Alias +JumpUp "if (myInventoryItem == 1) { +Jump;}"
Alias -JumpUp " -Jump; if(MyInventoryItem == 0){ Pukename \"JumpOff\";}"
DefaultBind kp2 +JumpUp
Well, really very need this feature :(
Gez
 
 
Posts: 17835
Joined: Fri Jul 06, 2007 3:22 pm

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

Post by Gez »

KEYCONF just lets you run [wiki]console commands[/wiki], nothing more complex. You might be able to do what you want with the test command; then you just need to find a way to get the inventory count as an expression you can evaluate in the console. Having a custom [wiki]console variable[/wiki] (defined with [wiki]CVARINFO[/wiki]) and a script that every tic checks the player's inventory for that item and set the console variable to true or false could do the trick.

Code: Select all

Alias +JumpUp "test custom_jumpitem +Jump"
Alias -JumpUp " -Jump; test custom_jumpitem ; Pukename \"JumpOff\""
This might work. (I'm not sure ; is a valid "nop" instruction.)
User avatar
Alekv
Posts: 170
Joined: Mon Jun 08, 2015 12:41 am
Location: My world :)
Contact:

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

Post by Alekv »

Thank for respons.
The condition I need for that would block a specific button.
For example the player has pressed the jump button is activated keyconf alias.
alias starts run in my script and command "+ jump". And if I need that would only run the script, and the command "+ jump" did not work, the "if" conditions come in handy.
This is just an example why do I need it.
Gez
 
 
Posts: 17835
Joined: Fri Jul 06, 2007 3:22 pm

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

Post by Gez »

There's no possibility of instruction blocks, console commands are very limited in their syntax. Keep in mind it's meant to be just commands typed line after line in the console; not programs. There's even a limit to how long they can be (255 characters).

However, you can use aliases to make functions, and you can use test to perform conditional execution. That's how far you can go, no further.


If you need more, you'll have to use real scripting. Until ZScript is complete, you can try to look in ACS's [wiki]GetPlayerInput[/wiki] feature, which can intercept jump.
User avatar
DoomKrakken
Posts: 3482
Joined: Sun Oct 19, 2014 6:45 pm
Location: Plahnit Urff
Contact:

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

Post by DoomKrakken »

How do I make a monster go slower when it receives a CustomInventory item?

I have an explosive ice attack, and I want it to temporarily slow down monsters. Maybe by doubling their tic durations or something like that. Is this at all possible?
User avatar
Gothic
Posts: 801
Joined: Thu Jun 16, 2011 6:49 pm

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

Post by Gothic »

You can do that with custom damage types and pain states. Here's an example:

Code: Select all

Actor StunnedImp : DoomImp replaces DoomImp
{
States
{
See:
	TNT1 A 0 A_JumpIfInventory("SlowDownPowerUp",1,"SlowWalk")
	TROO AABBCCDD 3 A_Chase
	Loop
SlowWalk:
	TROO AABBCCDD 6 A_Chase
	Goto See
Melee:
Missile:
	TNT1 A 0 A_JumpIfInventory("SlowDownPowerUp",1,"SlowAttack")
	TROO EF 8 A_FaceTarget
	TROO G 6 A_TroopAttack 
	Goto See
SlowAttack:
	TROO EEFF 8 A_FaceTarget
	TROO G 12 A_TroopAttack 
	Goto See
Pain:
	TNT1 A 0 A_JumpIfInventory("SlowDownPowerUp",1,"SlowPain")
	TROO H 2
	TROO H 2 A_Pain
	Goto See
Pain.SlowDown:
	TNT1 A 0 A_GiveInventory("SlowDownPowerUp")
SlowPain:
	TROO H 4
	TROO H 4 A_Pain
	Goto See
}
}

Actor RetardantRocket : Rocket replaces Rocket
{
Damage 1 //Reduced so they don't die instantly
DamageType "SlowDown"
States
{
Death:
	MISL B 8 Bright A_Explode(1,128) //Same
	MISL C 6 Bright
	MISL D 4 Bright
	Stop
}
}

Actor SlowDownPowerUp : Powerup
{
Powerup.Duration -15
}
The custom rocket has a special damagetype ("slowdown") that makes the imps acquire a "powerup" so they can enter on custom states. This powerup only lasts 15 seconds.
User avatar
DoomKrakken
Posts: 3482
Joined: Sun Oct 19, 2014 6:45 pm
Location: Plahnit Urff
Contact:

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

Post by DoomKrakken »

Thanks for the explanation, but I was trying to avoid that altogether.

I wasn't clear before... I was looking to see if there was a way to do it via CustomInventory item without needing to change the code in the monsters themselves. Was there a function already made that would do this?

P.S.: My preferred method for giving monsters CustomInventory items is via [wiki]A_RadiusGive[/wiki], with the RGF_MONSTERS flag included. :)
D2JK
Posts: 543
Joined: Sat Aug 30, 2014 8:21 am

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

Post by D2JK »

I decided to make a custom CVar for quicker adjusting of certain values on weapons, monsters, etc. It works fine and I can always open the console to modify this value, but is it possible to make keybinds to increment/decrement this value for me?

For example, in Quake Live I could do: "bind mwheelup cvaradd m_sensitivity .01". Is there anything similar in ZDoom?
User avatar
Zan
Posts: 338
Joined: Sat Oct 22, 2016 12:43 pm
Location: The depths of Hedon.
Contact:

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

Post by Zan »

Hey, guys, anyone knows how to make the screen sway/shake when using a weapon?
I am working on an axe, and wanted to give it more feel when you swing it.

I remember the dizziness effect caused by spiders in Blood, which used to tilt your view, does GZDoom have a similar feature?
User avatar
Gothic
Posts: 801
Joined: Thu Jun 16, 2011 6:49 pm

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

Post by Gothic »

Ok so I have a set of weapons that damage the player when you shoot them, similar to the Sigil, using this script

Code: Select all

Script "BloodPay" (int damage)
{
	Thing_Damage2(0,damage,"Suicide");
}
And the weapons use this function

Code: Select all

ACS_NamedExecute("BloodPay",0,damage)
The ammounts of damage are 2,3 and 4 for these weapons. However when I grab a QuadDamage powerup they deal 4 times the damage amount, and I want to avoid that, so my questions are:

-How can I make this script not to be affected by the QuadDamage powerup? (This is the one that interest me most)
-How can I make them deal the same ammount of damage with and without armor?
-Is there any way to damage the player without making pain sounds (similar to the PAINLESS flag for a projectile)?
User avatar
DoomKrakken
Posts: 3482
Joined: Sun Oct 19, 2014 6:45 pm
Location: Plahnit Urff
Contact:

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

Post by DoomKrakken »

Where can I get a compiled build of ACC that is compatible with KILL scripts?
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

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

Post by Blue Shadow »

Gothic wrote:-How can I make this script not to be affected by the QuadDamage powerup? (This is the one that interest me most)
-How can I make them deal the same ammount of damage with and without armor?
-Is there any way to damage the player without making pain sounds (similar to the PAINLESS flag for a projectile)?
Instead of calling an ACS script, use [wiki]A_DamageSelf[/wiki] like this:

Code: Select all

A_DamageSelf(<damage>, "Suicide", DMSS_NOPROTECT | DMSS_NOFACTOR, "None", "None", AAPTR_NULL, AAPTR_NULL)
That should solve issue #1 and #2.

For #3, you need to modifiy the player actor by adding this:

Code: Select all

PainChance "Suicide", 0
DoomKrakken wrote:Where can I get a compiled build of ACC that is compatible with KILL scripts?
Apart from compiling one yourself, you can get it from GZDoom Builder.
User avatar
DoomKrakken
Posts: 3482
Joined: Sun Oct 19, 2014 6:45 pm
Location: Plahnit Urff
Contact:

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

Post by DoomKrakken »

I haven't the slightest clue how to compile it myself. Not to mention, when I try to get it from the latest build of GZDoom Builder, it still gives me the same error... that it hadn't compiled correctly.
Locked

Return to “Editing (Archive)”