The "How do I..." Thread

Discuss all aspects of editing for ZDoom.
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

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

Postby Nevander » Wed Nov 30, 2016 10:35 pm

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 allExpand view
Sprite PISGA0, 56, 87
{
   YScale 1.2
   Offset -125, -115
   Patch PISGA0, 0, 0
}
Nevander
Self-Banned User
 
Joined: 06 Jan 2014

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

Postby YukiHerz » Thu Dec 01, 2016 11:55 am

Thanks, that works.
User avatar
YukiHerz
Expensive pasta dude
 
Joined: 02 Dec 2013
Location: Where corruption is redefined daily.
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: Intel (Legacy GZDoom)

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

Postby Alekv » Thu Dec 01, 2016 3:36 pm

Tell me, what is the probability that KEYSONF add if{..}?
Like this:
Code: Select allExpand view
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 :(
User avatar
Alekv
 
Joined: 08 Jun 2015
Location: My world :)

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

Postby Gez » Thu Dec 01, 2016 4:48 pm

KEYCONF just lets you run console commands, 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 console variable (defined with CVARINFO) 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 allExpand view
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.)
Gez
 
 
 
Joined: 06 Jul 2007

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

Postby Alekv » Thu Dec 01, 2016 5:25 pm

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.
User avatar
Alekv
 
Joined: 08 Jun 2015
Location: My world :)

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

Postby Gez » Fri Dec 02, 2016 7:49 am

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 GetPlayerInput feature, which can intercept jump.
Gez
 
 
 
Joined: 06 Jul 2007

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

Postby DoomKrakken » Fri Dec 02, 2016 1:54 pm

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
DoomKrakken
Avidly Anonymous Suggester. Hardcore Catholic Gamer. Problem? PM me.
 
Joined: 19 Oct 2014
Location: Plahnit Urff
Discord: DoomKrakken#2719

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

Postby Gothic » Fri Dec 02, 2016 5:52 pm

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

Code: Select allExpand view
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
Gothic
To be fair, you have to have a very high IQ to understand ZScript.
 
Joined: 16 Jun 2011
Location: Where it all began...
Discord: #1462

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

Postby DoomKrakken » Fri Dec 02, 2016 7:10 pm

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 A_RadiusGive, with the RGF_MONSTERS flag included. :)
User avatar
DoomKrakken
Avidly Anonymous Suggester. Hardcore Catholic Gamer. Problem? PM me.
 
Joined: 19 Oct 2014
Location: Plahnit Urff
Discord: DoomKrakken#2719

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

Postby D2JK » Sat Dec 03, 2016 10:36 am

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?
D2JK
 
Joined: 30 Aug 2014

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

Postby Zan » Sat Dec 03, 2016 11:55 am

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
Zan
 
Joined: 22 Oct 2016
Location: The depths of Hedon.

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

Postby Gothic » Sat Dec 03, 2016 12:15 pm

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 allExpand view
Script "BloodPay" (int damage)
{
   Thing_Damage2(0,damage,"Suicide");
}


And the weapons use this function

Code: Select allExpand view
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
Gothic
To be fair, you have to have a very high IQ to understand ZScript.
 
Joined: 16 Jun 2011
Location: Where it all began...
Discord: #1462

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

Postby DoomKrakken » Sat Dec 03, 2016 3:55 pm

Where can I get a compiled build of ACC that is compatible with KILL scripts?
User avatar
DoomKrakken
Avidly Anonymous Suggester. Hardcore Catholic Gamer. Problem? PM me.
 
Joined: 19 Oct 2014
Location: Plahnit Urff
Discord: DoomKrakken#2719

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

Postby Blue Shadow » Sat Dec 03, 2016 4:22 pm

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 A_DamageSelf like this:

Code: Select allExpand view
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 allExpand view
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
Blue Shadow
 
 
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: ATI/AMD (Modern GZDoom)

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

Postby DoomKrakken » Sat Dec 03, 2016 4:49 pm

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.
User avatar
DoomKrakken
Avidly Anonymous Suggester. Hardcore Catholic Gamer. Problem? PM me.
 
Joined: 19 Oct 2014
Location: Plahnit Urff
Discord: DoomKrakken#2719

PreviousNext

Return to Editing (Archive)

Who is online

Users browsing this forum: Google [Bot] and 3 guests