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
FranckyFox2468
Posts: 136
Joined: Sat Nov 28, 2015 2:42 pm

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

Post by FranckyFox2468 »

Code: Select all

int WaterPumplevel = 0;	
script 6 (void)
{
	WaterPumplevel++
if (WaterPumplevel == [3])
 {
 print(s:"You should be able to swim across the gap now!");
 }
else
 if (WaterPumplevel == 2)
  {
  print(s:"One more should suffice!");
  }
 else
  if (WaterPumplevel == 1)
  {
  print(s:"Its going up, still too low to get across though...");
  }
}
I think i am doing something wrong cause GZDoom builder ain't liking this.
Nevander
Posts: 2254
Joined: Mon Jan 06, 2014 11:32 pm

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

Post by Nevander »

EDIT: You are missing a semicolon after WaterPumplevel++, and probably don't want [ ] around the 3.

------------

Also just to note useCount++; and useCount = useCount + 1; are the same thing.

Me personally I prefer to use the second one so I can visualize the variable being incremented. AFAIK it's a matter of preference unless there's something about the other way that is actually different or better.
User avatar
FranckyFox2468
Posts: 136
Joined: Sat Nov 28, 2015 2:42 pm

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

Post by FranckyFox2468 »

Nevander wrote:EDIT: You are missing a semicolon after WaterPumplevel++, and probably don't want [ ] around the 3.

------------

Also just to note useCount++; and useCount = useCount + 1; are the same thing.

Me personally I prefer to use the second one so I can visualize the variable being incremented. AFAIK it's a matter of preference unless there's something about the other way that is actually different or better.
uh thanks but that doesn't answer to why my thing doesn't work
Elias79
Posts: 50
Joined: Mon Jan 30, 2017 6:09 am

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

Post by Elias79 »

Is there a way to store information even after the map is reset?

It tried to use a script to prevent player movement before the countdown in Co-op Survival but i cant prevent the OPEN and ENTER from running twice,
also the RETURN does not get triggered and REOPEN does not even want to compile, so how could i store mod data across maps and levels?

Code: Select all

#library "CVARS"
#include "zcommon.acs"

int counter = 0;

script 1001 OPEN
{
while (counter < 1000)
   {
   Delay(3);
   counter++;
   print(d:counter);
   Delay(3);
   }   
}
Blue Shadow
Posts: 5043
Joined: Sun Nov 14, 2010 12:59 am

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

Post by Blue Shadow »

If I understand the problem, I think you want [wiki=Scope]global variables[/wiki].
LogicalFallacy
Posts: 89
Joined: Tue May 24, 2016 8:59 am

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

Post by LogicalFallacy »

The variable has to be defined outside of any scripts, as in my first example, to be a public variable. His OPEN script just accesses it to see if it's hit the target.
User avatar
SoundOfDarkness
Posts: 114
Joined: Tue Feb 28, 2017 5:53 pm
Location: at home

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

Post by SoundOfDarkness »

I fiddled in some mods the last days and learned to adjust weapon damage thanks to kodi, KuroTsuki and the ZDoom Wiki.
Now I'm trying to adjust the fire rate. I checked the Wiki but couldn't find what I'm looking for. Any help?
LogicalFallacy
Posts: 89
Joined: Tue May 24, 2016 8:59 am

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

Post by LogicalFallacy »

SoundOfDarkness wrote:I fiddled in some mods the last days and learned to adjust weapon damage thanks to kodi, KuroTsuki and the ZDoom Wiki.
Now I'm trying to adjust the fire rate. I checked the Wiki but couldn't find what I'm looking for. Any help?
For that you'll want to adjust how long the animation takes. So for example the fire state of the pistol is

Code: Select all

PISG A 4
PISG B 6 A_FirePistol
PISG C 4
PISG B 5 A_ReFire
Goto Ready
To make it shoot faster, you could change it to

Code: Select all

PISG A 2
PISG B 4 A_FirePistol
PISG C 2
PISG B 3 A_ReFire
Goto Ready
This would shorten the fire time from 19 frames to 11, or about .2 seconds faster. Keep in mind that if what you're tweaking has a flash state, you'll want to adjust that as well.
User avatar
SoundOfDarkness
Posts: 114
Joined: Tue Feb 28, 2017 5:53 pm
Location: at home

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

Post by SoundOfDarkness »

Thanks for the quick help. :)

Edit:
It takes 2 hits to kill a shotgun guy, when the damage value is in brackets.

Code: Select all

Radius 8
	Height 2
	Speed 30
	Damage (30)
	scale 0.3
	gravity 0.05
	Projectile
	BounceType "grenade"
	bouncesound "razorjack/bounce"
	bouncefactor 1
	wallbouncefactor 1
	bouncecount 6
	+BLOODSPLATTER
	+USEBOUNCESTATE
	States
Just removing the brackets makes them go splat like a direct hit with the rocket launcher. :?

Code: Select all

Radius 8
	Height 2
	Speed 30
	Damage 30
	scale 0.3
	gravity 0.05
	Projectile
	BounceType "grenade"
	bouncesound "razorjack/bounce"
	bouncefactor 1
	wallbouncefactor 1
	bouncecount 6
	+BLOODSPLATTER
	+USEBOUNCESTATE
	States
And again some explanation please.
User avatar
DoomKrakken
Posts: 3489
Joined: Sun Oct 19, 2014 6:45 pm
Location: Plahnit Urff
Contact:

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

Post by DoomKrakken »

Can different weapon overlays have their own Gunflash?
Blue Shadow
Posts: 5043
Joined: Sun Nov 14, 2010 12:59 am

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

Post by Blue Shadow »

SoundOfDarkness wrote:It takes 2 hits to kill a shotgun guy, when the damage value is in brackets.
In this case the projectile always does 30 damage per hit.
Just removing the brackets makes them go splat like a direct hit with the rocket launcher. :?
In this one the projectile does a random amount of damage each hit, between 30 and 240. The damage is calculated like this:

Code: Select all

damage * random(1, 8) // Pick a random value between 1 and 8, and multiply it by 'damage'.   
For reference, see [wiki=Actor_properties#Damage]the damage property[/wiki].
LogicalFallacy
Posts: 89
Joined: Tue May 24, 2016 8:59 am

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

Post by LogicalFallacy »

DoomKrakken wrote:Can different weapon overlays have their own Gunflash?
Absolutely! Each of the vanilla weapons already does!
User avatar
DoomKrakken
Posts: 3489
Joined: Sun Oct 19, 2014 6:45 pm
Location: Plahnit Urff
Contact:

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

Post by DoomKrakken »

I know the vanilla weapons do. But basically... say I have two overlays, for dual-wielding. Can they both execute a gunflash without one gunflash interfering with another gunflash?
LogicalFallacy
Posts: 89
Joined: Tue May 24, 2016 8:59 am

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

Post by LogicalFallacy »

Ah. From a glance at the wiki, A_GunFlash lets you point it at whatever state you want, so you can definitely make an AltFlash state if you want and it should work as you desire.

Page for reference: https://zdoom.org/wiki/A_GunFlash
XASSASSINX
Posts: 380
Joined: Tue Dec 20, 2016 4:53 pm
Location: MURICAA BROTHER! Just kidding, Brazil.

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

Post by XASSASSINX »

How do i make a weapon use 2 ammos at the same time? i'm making a flare gun that use 10 of cell and 1 rocket. Do i use a weapon property?
Locked

Return to “Editing (Archive)”