Cutstuff Forum

Mega Man 8-bit Deathmatch => Projects & Creative => DECORATE and ACS Modifications => Topic started by: MagnetMan497 on February 23, 2011, 02:52:33 AM

Title: The "How do I make a weapon do that?" thread
Post by: MagnetMan497 on February 23, 2011, 02:52:33 AM
Ivory, If you do not like this topic you can lock it.

In this topic you can politely ask how or why your weapon is doing something/acting starangely. Hopefully someone will politely help you.

For me:
Why doesn't SlumpED recognize the Scale 2.0?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Lio on February 23, 2011, 03:04:31 AM
^ Recognize? I don't remember correctly but maybe Slumped is far behind on ZDoom coding, so probably Scale doesn't appears blue like many other flags. Otherwise, I'm not sure what you're trying to say.
Title: Re: The "How do I make a weapon do that?" thread
Post by: tsukiyomaru0 on February 23, 2011, 03:07:53 AM
Due to my personal issues with SlumpEd, I have left it long ago to use Slade, which is much more flexible and recognize many flags, actions, states and properties that aren't even coded into skulltag but are somewhat recent in ZDoom. BUT be sure to NOT use the MM8BDM Launcher  to playtest your stuff, 'cause it WILL crash Slade (dunno why, but does often here.)
Title: Re: The "How do I make a weapon do that?" thread
Post by: OZX on May 19, 2011, 07:50:28 PM
im goin to attempt to make the z saber.problem is, im loaded with homework and im lazy sometimes.can someone give me a website to find the z-saber in 8-bit?
Title: Re: The "How do I make a weapon do that?" thread
Post by: tsukiyomaru0 on May 19, 2011, 09:37:44 PM
Quote from: "omegazerox12"
im goin to attempt to make the z saber.problem is, im loaded with homework and im lazy sometimes.can someone give me a website to find the z-saber in 8-bit?
http://www.sprites-inc.co.uk/files/X/Zello/Xtreme/ (http://www.sprites-inc.co.uk/files/X/Zello/Xtreme/)
Title: Re: The "How do I make a weapon do that?" thread
Post by: MasterXman on June 15, 2011, 06:03:05 PM
How do I make a Weapon charge up? I'm currently working on a class. Samus Aran.
Title: Re: The "How do I make a weapon do that?" thread
Post by: tsukiyomaru0 on June 15, 2011, 06:38:58 PM
Quote from: "xxkirbysonicxx1"
How do I make a Weapon charge up? I'm currently working on a class. Samus Aran.
There are two ways to do this. One is the Mega Buster/Proto Buster style, the other is a custom, two "hold" style. For either, check these:

Arrow Shot (uses the same system as Mega Buster or Proto Buster):
http://www.mediafire.com/?fu8tuoj8a0qjt84 (http://www.mediafire.com/?fu8tuoj8a0qjt84)

Aurora Cannon (Uses the custom "twin hold" style):
http://www.mediafire.com/?24jpek659lmur7m (http://www.mediafire.com/?24jpek659lmur7m)

Further questions, feel free to ask in my thread or through Personal Message, I'm always active.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Atticus on June 15, 2011, 11:51:55 PM
How could I make a weapon fly in an arc? I'm (thinking) about doing the Tornado Hold.
Title: Re: The "How do I make a weapon do that?" thread
Post by: tsukiyomaru0 on June 16, 2011, 01:14:39 AM
Quote from: "coolguy773"
How could I make a weapon fly in an arc? I'm (thinking) about doing the Tornado Hold.
Make a normal projectile and add the flag "-NOGRAVITY" to make it be affected by the gravity pull. Then add a behavior like that of the Flame Blast (except it will spawn a fan instead of a flame tower)
Title: Re: The "How do I make a weapon do that?" thread
Post by: OZX on June 19, 2011, 02:23:35 PM
Quote from: "tsukiyomaru0"
Quote from: "omegazerox12"
im goin to attempt to make the z saber.problem is, im loaded with homework and im lazy sometimes.can someone give me a website to find the z-saber in 8-bit?
http://www.sprites-inc.co.uk/files/X/Zello/Xtreme/ (http://www.sprites-inc.co.uk/files/X/Zello/Xtreme/)


i meant in like mm8bdm form, or unless someone would like to do that part for me. :/
Title: Re: The "How do I make a weapon do that?" thread
Post by: tsukiyomaru0 on June 19, 2011, 05:02:17 PM
Quote from: "omegazerox12"
Quote from: "tsukiyomaru0"
Quote from: "omegazerox12"
im goin to attempt to make the z saber.problem is, im loaded with homework and im lazy sometimes.can someone give me a website to find the z-saber in 8-bit?
http://www.sprites-inc.co.uk/files/X/Zello/Xtreme/ (http://www.sprites-inc.co.uk/files/X/Zello/Xtreme/)


i meant in like mm8bdm form, or unless someone would like to do that part for me. :/
You mean the rotation, eh? I know many who are capable. Tomorrow I can do for you, if you can find none.
Title: Re: The "How do I make a weapon do that?" thread
Post by: TheBladeRoden on June 19, 2011, 07:38:59 PM
I suppose I'll ask here the question from my dead thread.

How to make projectiles blocked by linedefs that are only set to block players?

And does anyone know how to get global variables to function globally?
Title: Re: The "How do I make a weapon do that?" thread
Post by: tsukiyomaru0 on June 19, 2011, 10:50:06 PM
Quote from: "TheBladeRoden"
I suppose I'll ask here the question from my dead thread.

How to make projectiles blocked by linedefs that are only set to block players?

And does anyone know how to get global variables to function globally?
Test if the monster combo allows the object to pass through it or not (but keep "projectile" out of it)
If the object is blocked, then the anser might lie in the activation of these flags:
*CANPUSHWALLS
    Upon hitting a wall this actor can activate P1/PR lines.
    ? Automatically given by the Monster combo

*ACTIVATEMCROSS
    This actor can activate 'Monster crosses' lines.
    ? Automatically given by the Monster combo

But I'm not sure, so....
Title: Re: The "How do I make a weapon do that?" thread
Post by: OZX on June 29, 2011, 03:51:06 AM
That would be nice tsukiyomaru0 and srry for late reply
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on July 03, 2011, 12:07:40 PM
I want to make a weapon that stops you from moving whenever you charge up. It works like proto buster does and I want it to stop the player whenever from moving and jumping when charging up. (Turning is still possible)
Title: Re: The "How do I make a weapon do that?" thread
Post by: tsukiyomaru0 on July 03, 2011, 03:37:28 PM
Quote from: "Michael712"
I want to make a weapon that stops you from moving whenever you charge up. It works like proto buster does and I want it to stop the player whenever from moving and jumping when charging up. (Turning is still possible)
Repeated A_Stop calls or a certain "changeplayerproperty" or something.
Title: Re: The "How do I make a weapon do that?" thread
Post by: FCx on August 12, 2011, 02:04:01 AM
*finally bump this topic*
I need help :| : I'm modding 2 weapons and joining into 1 weapon (tiberium autorifle and time stop from flashman class) the problem is the folllowing:

When I pasted the code I saw
Code: [Select]
ACS_Execute(978,0) (this code force bots to use megabuster)
I tried removing it but when I tested, skulltag died and freezed my PC :mad:

Anyone knows what's the problem???
(click to show/hide)
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on August 25, 2011, 11:53:29 AM
How do I make it so that the weapon can only be used in mid-air? The weapon I'm making is like an air dash and I don't want people using it on the ground
Title: Re: The "How do I make a weapon do that?" thread
Post by: xColdxFusionx on August 25, 2011, 02:06:35 PM
Quote from: "Michael712"
How do I make it so that the weapon can only be used in mid-air? The weapon I'm making is like an air dash and I don't want people using it on the ground

Taken from Top Spin's code (I'm not sure if this is 100% accurate, you'll have to double-check it):

A_JumpIf(momz == 0, "NoAmmo")
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on August 26, 2011, 08:23:17 PM
Thank you! That certainly seems to be working. But there's 2 more things. One I can get from looking at another weapon so I wont ask that. But the other one is how would I make the player keep the same Z height for a certain amount of time? Would it be some sort of inventory item? (Is it possible?)
Title: Re: The "How do I make a weapon do that?" thread
Post by: xColdxFusionx on August 27, 2011, 01:33:25 AM
Quote from: "Michael712"
Thank you! That certainly seems to be working. But there's 2 more things. One I can get from looking at another weapon so I wont ask that. But the other one is how would I make the player keep the same Z height for a certain amount of time? Would it be some sort of inventory item? (Is it possible?)

I would say "try A_Stop", but
a.) I'm not sure it would work in a weapon, and
b.) You're trying to make an air-dash, so...
Title: Re: The "How do I make a weapon do that?" thread
Post by: Max on August 27, 2011, 09:41:58 AM
A_Stop
SetPlayerProperty(0,1,0)
SetPlayerProperty(0,1,3)
A_Recoil
SetPlayerProperty(0,0,0)
SetPlayerProperty(0,0,3)
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on August 27, 2011, 08:01:43 PM
Errrrrm, how exactly do I....y'know, use it? I keep getting shot at by errors. I keep trying many different things but I'm confused

(click to show/hide)

Dang this weapon is harder to make than I thought. I should be more careful when choosing the expansion weapons :/
Title: Re: The "How do I make a weapon do that?" thread
Post by: Gummywormz on August 27, 2011, 08:04:48 PM
A_Recoil needs a number. Since you want it to go forward, you have to use a negative one, like A_Recoil(-80).
Title: I feel like such a derp now
Post by: BiscuitSlash on August 27, 2011, 08:07:39 PM
Ah, no wonder it kept saying it expected "(". Thanks Gummywormz and Yellow Devil!
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on September 03, 2011, 12:45:39 AM
How would I apply more than one damagetype to a single weapon/projectile?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on September 03, 2011, 03:18:20 AM
Secretly fire two projectiles?

Have one projectile spawn an item on death that explodes, dealing a different damagetype?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on September 03, 2011, 10:59:41 PM
How would I give a random speed to a projectile? As in, every time I fired a weapon, its projectile would move at a different speed.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on September 03, 2011, 11:08:41 PM
Could have it randomly fire between several projectiles that have the same stats except for speed.

I did something similar with my slingshot weapon, except there's a noticeable pattern.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on September 03, 2011, 11:10:45 PM
Alright, how would I randomly pick between A_FireCustomMissle statements?

And is it possible to "parent" projectiles in Skulltag? As in, just make a "child" projectile with one line (the different speed attribute)? How would you do so?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Max on September 03, 2011, 11:14:02 PM
A_Jump(256,"Option One","Option Two") etc

Actor FastShot : SlowShot
{
Speed xxxx
}

Exactly the same as slowshot, but with different speed.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on September 03, 2011, 11:16:01 PM
Cool beans. :cool: And with that, Aqua Guts has been completed. Thanks!
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on September 03, 2011, 11:26:30 PM
Okay, new problem.

Using A_Jump, the code execution literally leaps to a different state. Usually not a problem, but I want six projectiles (all with different random speeds, mind you) to shoot out of one weapon fire. How would I accomplish this?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Max on September 03, 2011, 11:28:46 PM
After firing, give a flag and then go back to fire. If they have fired the amount of shots you need them to (and have the desired number of flags) send 'em to ready.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on September 03, 2011, 11:42:42 PM
Bet you're tired of seeing my face here, but new problem.

How would I play a charging sound "once"? As in, have the sound play and not loop over and over?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Max on September 03, 2011, 11:46:35 PM
...Remove the extra A_PlaySoundEx s?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on September 03, 2011, 11:51:29 PM
But I only have one. Problem is, the game likes calling it many times.
Code: [Select]
Fire:
GUTS B 0 A_JumpIfNoAmmo("NoAmmo")
GUTS B 1
Goto Hold

Hold:
GUTS B 0 A_JumpIfNoAmmo("NoAmmo")
GUTS B 0 A_JumpIfInventory("BustCharge",12,"Hold2")
GUTS B 2 A_GiveInventory("BustCharge",1)
GUTS B 0 ACS_ExecuteAlways(994,0)
GUTS B 0 A_Refire
Goto Fire1

Hold2:
GUTS B 0 A_StopSoundEx ("Weapon")
GUTS B 0 A_PlaySoundEx("weapon/bncharge1", "Weapon")
GUTS B 0 A_JumpIfInventory("BustCharge",32,"Hold3")
GUTS B 1 ACS_ExecuteAlways(991,0,404)
GUTS B 0 ACS_ExecuteAlways(991,0,403)
GUTS B 2 A_GiveInventory("BustCharge",1)
GUTS B 0 A_Refire
Goto Fire2


EDIT: While I'm thinking about it, what does script 994 do? I just copypasta'd code lawl
Title: Re: The "How do I make a weapon do that?" thread
Post by: Max on September 03, 2011, 11:56:08 PM
Instead of fire going to hold, make it go to a simple sound frame that plays the beginning of the charge (green) and make the inventory check go to a different frame that plays the finished (purple) sound and then goes to Hold2.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on September 04, 2011, 12:09:54 AM
You've obviously played Battle Network before if you remember the charge colors.

Also thanks :cool:
Title: Re: The "How do I make a weapon do that?" thread
Post by: DarkAura on September 05, 2011, 01:43:08 AM
How do I make it so a projectile doesn't activate it's death animation unless it hits another player or actor?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Ukiyama on September 05, 2011, 01:45:15 AM
How do I make a projectile weave up and down (similar to A_CStaffMissileSlither but vertically)?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on September 05, 2011, 02:40:53 AM
I'd assume ThrustThingZ, 'cause that's how I did it for Dive Mines.
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on September 05, 2011, 04:00:01 PM
Quote from: "DarkAura"
How do I make it so a projectile doesn't activate it's death animation unless it hits another player or actor?
In the "spawn" part (or whatever it's called), if you want it to keep playing the animation then add "loop" at the end of it. Example would be:
Code: [Select]
Spawn:
M712 AB 3
loop
Something like that.

If you want it to bounce on walls as well, then either a "+DOOMBOUNCE" or "+HEXENBOUNCE" flag to the main projectile properties. As long as it doesn't have a "+RIPPER" flag, it should only ever disappear when it has hit the enemy.
Title: Re: The "How do I make a weapon do that?" thread
Post by: DarkAura on September 05, 2011, 04:03:04 PM
Sorry, should've been more descriptive.

I meant, "How do I make it so the death animation only plays when it hits another monster, and skips the animation when it hits a wall/floor/cieling/etc.?"
Title: Re: The "How do I make a weapon do that?" thread
Post by: Gummywormz on September 05, 2011, 04:10:20 PM
I think what you would do is make an XDeath state and make that do what you want. Then make a seperate death state that does nothing. XDeath should be what happens when it hits a player. Death state should be what happens when it hits a wall.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on September 05, 2011, 04:14:41 PM
I want to make a ground-based weapon like Bubble Lead or Wind Storm. The projectile's supposed to do 15 damage. However, for some reason the infamous "bubble doubling" occurs and shots do 30 damage instead! How do I prevent this from happening?

Code: [Select]
actor BubblerAttack
{
obituary "????? it's a secret! Can't reveal it yet."
-SOLID
PROJECTILE
-NOGRAVITY
Damage (15)
Height 16
Radius 20
Scale 2.5
gravity 1.0
speed 15
States
{
Spawn:
BUBB A 4
BUBB A 0 A_GiveInventory("Clip",1)
BUBB BCB 4
loop
Death:
TNT1 A 0 A_JumpIfInventory("Clip",1,"Continue")
TNT1 A 1
stop
Continue:
TNT1 A 0  A_CustomMissile("BubblerAttack",0,0,0,2,0)
TNT1 A 1
stop
}
}
Title: Re: The "How do I make a weapon do that?" thread
Post by: Max on September 05, 2011, 04:16:32 PM
What the bubble lead does is continue on death. So when it hits an actor, it still continues. Adding

Code: [Select]
Crash:
TNT1 A 1
Stop

Should fix it, as crash is the state entered when hitting a player.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on September 05, 2011, 04:21:27 PM
Alright, new question.

Suppose I put actual sprites in Crash instead of a transparent one. Would these sprites "play" when the Bubbler hits a player? I'm asking because I want the "foam" from the Bubbler to only play when it hits a player.

EDIT: I'm aware of the Death vs XDeath question above. I was just curious about Crash to see if it'll save some steps.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Gummywormz on September 05, 2011, 04:23:23 PM
Crash is what happens when it hits a floor if I remember correctly.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Max on September 05, 2011, 04:25:05 PM
Quote from: "SmashBroPlusB"
Alright, new question.

Suppose I put actual sprites in Crash instead of a transparent one. Would these sprites "play" when the Bubbler hits a player? I'm asking because I want the "foam" from the Bubbler to only play when it hits a player..

Yes

Quote from: "Gummywormz"
Crash is what happens when it hits a floor if I remember correctly.

Nope
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on September 05, 2011, 06:56:42 PM
How would I make a weapon's attack proportional to the user's HP? As in, I want to make an attack become stronger (or weaker) with a DIRECT ratio to the attacker's health. This means for every 1 HP I lose, my attack will become 1 point stronger/weaker.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on September 05, 2011, 07:27:32 PM
Check Murumasa from ye olde Classes.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Max on September 05, 2011, 07:41:17 PM
Quote from: "SmashBroPlusB"
How would I make a weapon's attack proportional to the user's HP? As in, I want to make an attack become stronger (or weaker) with a DIRECT ratio to the attacker's health. This means for every 1 HP I lose, my attack will become 1 point stronger/weaker.

Old Murumasa didn't do this. However, the general theme is there. The only way I can think of to make a direct change is to make 100 checks and 100 projectiles!!
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on September 05, 2011, 07:42:34 PM
SHIT.

So I can't call "health" like a variable? I have to literally make ONE HUNDRED CHECKS?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Max on September 05, 2011, 07:46:08 PM
XXXX A 0 A_JumpIfHealthLower(100,"Fire100")
XXXX A 0 A_JumpIfHealthLower(99,"Fire99")
XXXX A 0 A_JumpIfHealthLower(98,"Fire98")

etc etc

HAVE FUN!!!

EDIT : START AT 1, NOT 100! SILLY ME...
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on September 05, 2011, 07:54:14 PM
Grumble grumble...

Everyone else, don't consider my question "closed". If you find ANY better way to do this, for the love of all things Mega Man PLEASE PLEASE PLEEEEEEEEAAAAAAAASSSSSEEEEEEEEEE share it with me!

(I'm doing Hub Style last now.)
Title: Re: The "How do I make a weapon do that?" thread
Post by: TheBladeRoden on September 05, 2011, 08:30:56 PM
Will probably have to involve some ACS
http://zdoom.org/wiki/CheckActorProperty (http://zdoom.org/wiki/CheckActorProperty)
http://zdoom.org/wiki/SetActorProperty (http://zdoom.org/wiki/SetActorProperty)
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on September 09, 2011, 08:03:58 PM
Okay, sadly my weapon may only be good with a special thing that makes them go through players. Is this possible? As in going through actors?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on September 09, 2011, 08:48:40 PM
Keep in mind, it doesn't have to be 100% battle orientated. An air dash is useful enough on its own, any damage is just a helpful side effect.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Gummywormz on September 09, 2011, 09:01:46 PM
Give them an item that sets -solid. Then give an item that sets +solid.
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on September 10, 2011, 12:04:19 PM
Heh heh, this weapon is coming on well! In fact it's just about finished!....except....one more thing....

What exactly is it that makes bots jump when attacking with the weapon? Some sort of BotCheck? I looked in Top spin's coding and couldn't see anything. yes that's right, I care about bots -_-
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on September 10, 2011, 06:47:43 PM
ACS_Execute(195,0)

This thrusts a bot into the air.
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on September 11, 2011, 09:33:20 AM
Yay! It's done! Thank you to everyone that helped! This weapon was much harder to make than i thought without knowing all those code things. I'm sure Propel Blade and Flame Sword will be easier to make. inb4yes
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on September 12, 2011, 10:51:59 AM
I want to make a projectile change directions and start to fly backwards like Shadow Blade, but there's a catch: I want the direction change to be "gradual". This means I want the projectile to slowly come to a halt, then slowly speed up in the opposite direction. I don't want the projectile to just "jump" and start instantly moving backwards like Shadow Blade.

Any ideas on how to do this? :?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Ukiyama on September 25, 2011, 03:08:15 PM
Alright I got a new question... in the spoiler I have a weapon I've been working on (if you've played x8 you know where it comes from). I want it to be aimable and have the same velocity as it keeps "growing" in size. (I know its a spawnitemex projectile when it starts but that is just a temp thing so I could test the damage of it).

(click to show/hide)
Title: Re: The "How do I make a weapon do that?" thread
Post by: xColdxFusionx on September 25, 2011, 03:26:39 PM
A_SpawnItemEX doesn't save projectile parenting by default if used multiple times. Try something like this for the SpawnItemEX methods:

SQUE B 0 A_SpawnItemEx("SqueezeBombLevel1",0,5,35,15,0,0,0,SXF_TRANSFERPOINTERS)
Title: Re: The "How do I make a weapon do that?" thread
Post by: MasterXman on September 25, 2011, 04:06:16 PM
I can't make rockcube an item. How do I make it an item? Woof! more MMBN STUFF!
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on September 25, 2011, 06:07:44 PM
Okay I have another problem-y weapon.
(click to show/hide)
Title: Re: The "How do I make a weapon do that?" thread
Post by: Gummywormz on September 25, 2011, 06:11:50 PM
Custom pain states bro. And it needs to do at least 1 damage in order for it to do anything (usually)
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on September 25, 2011, 06:15:05 PM
Ack, I was hoping I wouldn't need to bother with it doing damage. It might defeat the purpose of the weapon.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Gummywormz on September 25, 2011, 06:16:23 PM
It's only needs 1 damage. You can even heal the damage in the painstate if you want.
Title: its all gone silent now...
Post by: MasterXman on September 25, 2011, 07:05:19 PM
Quote from: "xxkirbysonicxx1"
I can't make rockcube an item. How do I make it an item? Woof! more MMBN STUFF!
Did this just get ignored?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on September 25, 2011, 10:21:04 PM
Look at the game. Stare at it for three hours, then look at where the items are stored and learn.

Also, ZDoom Wiki.
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on September 26, 2011, 05:59:59 PM
Me again! Hi!

There's something really weird with this weapon that I can't understand. For some reason, even when it does (0) damage and there's no custom pain state, it actually DOES damage players. I can't understand why.
Here's the coding for the weapon.
(click to show/hide)
Title: Re: The "How do I make a weapon do that?" thread
Post by: Gummywormz on September 26, 2011, 09:50:30 PM
Because you have +RIPPER set. Which means it's gonna do more than 1 damage to the actor, since it constantly causes damage when going through.
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on September 27, 2011, 04:32:40 PM
Nope, it's still doing lots of damage. The ripper flag must be there to stop it from leaving upon contact. Even when set to 0 damage it will do lots of damage. Something tells me it has something to do with the RadiusThrust doing the damage. Anyway of avoiding that?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on September 27, 2011, 07:11:42 PM
Try commenting out RadiusThrust to see if it really is your problem.
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on September 27, 2011, 07:49:08 PM
Well, it turns out I forgot to put "Goto pain+1" after the custom pain state, which pain.Gravity happened to be fight after. No wonder it kept pushing me down! (I'm not too sure if whether or not that derpy feeling is good or bad).

Just need to heavily edit it now. Thanks again everyone!

EDIT: Ack, it's still doing damage! I don't know what it is but there's is SOMETHING there that is being annoying. Here's the coding for the weapon and the painstate:
(click to show/hide)
Title: Re: The "How do I make a weapon do that?" thread
Post by: Trollman on September 27, 2011, 08:16:16 PM
If it doesn't do damage, then shouldn't it lack a damagetype? (Sorry if it wouldn't work or something like that I am using common sense).
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on September 27, 2011, 08:23:24 PM
The damage type is only there so that in this case, it always switches the class flag to "PUSHABLE" whenever needed so that the radiusthrust can push them, but it might not even be necessary. I firstly need to nail down the problem of this thing doing damage, as even with all the damage and radiusthrust turned off, it still does random amounts of damage which can't really happen for this weapon.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on October 04, 2011, 02:04:52 PM
Bump for Yo-Yo
Quote from: "SmashBroPlusB"
I want to make a projectile change directions and start to fly backwards like Shadow Blade, but there's a catch: I want the direction change to be "gradual". This means I want the projectile to slowly come to a halt, then slowly speed up in the opposite direction. I don't want the projectile to just "jump" and start instantly moving backwards like Shadow Blade.

Any ideas on how to do this? :?
Thanks for passing by me, bro
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on October 04, 2011, 03:50:05 PM
Well....you could try making 100 projectiles....
Title: Re: The "How do I make a weapon do that?" thread
Post by: Ukiyama on October 04, 2011, 04:13:16 PM
Wait a minute, didn't yo-yo just go 3 forward, stop, and come back at the same speed... well anyway since shadow blade return is just it making a 180 degree turn which it is another object, I guess you could make like 7 actors of the yo yo that gradually decrease in spead then 7 more to speed back up, unless there is some flag like A_ScaleVelocity or something.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on October 04, 2011, 04:42:10 PM
Quote from: "Ukiyama"
Wait a minute, didn't yo-yo just go 3 forward, stop, and come back at the same speed...
Nope. It started off fast, but when the Yo-Yo approached the third panel it slows down instead of suddenly stopping.

I'll try the multi-actor method, but I was looking for an easier fix. I still have nightmares over Hub Style and his 62 projectile checks.... ugh.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Ukiyama on October 04, 2011, 04:46:31 PM
My newer version of Squeeze Bomb has 12 different actors so it scales up slowly and that didn't take very long to be honest, once ya make one just copy and paste, make a few minor adjustments and it should be quick, (might not be the most efficient by any means but I think it would work just fine).
Title: Re: The "How do I make a weapon do that?" thread
Post by: Gummywormz on October 04, 2011, 11:51:15 PM
Try playing with the already mentioned A_ScaleVelocity. (http://zdoom.org/wiki/A_ScaleVelocity)
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on October 07, 2011, 03:47:57 PM
So how do I make this projectile NOT do damage? (Right now with this coding it is.)
(click to show/hide)
Title: Re: The "How do I make a weapon do that?" thread
Post by: Max on October 07, 2011, 03:49:24 PM
-SOLID

I'd reccomend RadiusThrust instead of Damagetypes (especially since your projectile is supposed to do no damage).
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on October 07, 2011, 04:15:34 PM
Nope, it can still damage them, even when I set the height and radius to 0. The damage it does is usually around 40 for some reason. Does it have anything to do with that MageStaff tracking?
Title: Re: The "How do I make a weapon do that?" thread
Post by: xColdxFusionx on October 07, 2011, 04:19:43 PM
Quote from: "Michael712"
Nope, it can still damage them, even when I set the height and radius to 0. The damage it does is usually around 40 for some reason. Does it have anything to do with that MageStaff tracking?

Thrusting someone into a wall deals damage to them. That's why enemies die when you run at them with Leaf Shield on.
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on October 07, 2011, 04:32:55 PM
Even with the radius thrust removed, it still does damage. It seems that it does exactly 41% damage. I really don't think it's caused by that radius thrust, ripper damage, ripper flag, or anything like that.

EDIT: Okay, so after I removed the MageStaff tracking and the +SeekerMissile flag, the weapon is no longer doing any damage at all! The downside? It has no homing capabilities! Help?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Trollman on October 08, 2011, 07:52:38 PM
Does adding the seekermissile flag make it do damage?
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on October 08, 2011, 08:29:03 PM
Nope, it doesn't change anything. It seems like it definitely the MageStaffTrack thing, but that's what I need to make it home in.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Gummywormz on October 08, 2011, 08:37:03 PM
Try this: http://zdoom.org/wiki/A_SeekerMissile (http://zdoom.org/wiki/A_SeekerMissile)
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on October 09, 2011, 03:08:28 PM
Well, it doesn't work that well compared to mage staff tracking, but I guess it will have to do. Just gotta tweak it a lot. Thanks gummywormz!
Title: Re: The "How do I make a weapon do that?" thread
Post by: DarkAura on October 12, 2011, 03:08:26 AM
Aura - Is it possible to code a projectile (ex. a large meteor) to make it create an earthquake when it dies, or would it have to be scripted into the level itself?
Title: Pepole, the zdoom wiki exists for a reason.
Post by: Gummywormz on October 12, 2011, 03:19:59 AM
A_Quake works (http://zdoom.org/wiki/A_Quake)
Title: Re: The "How do I make a weapon do that?" thread
Post by: DarkAura on October 12, 2011, 03:37:38 AM
Aura - I think I tried putting in A_Quake before. It wouldn't appear highlighted in the script and it comes up:
Script error, "MeteorTest.wad:DECORATE" line 96:
Invalid state parameter a_quake
when I try to load it.

Code: [Select]
actor BigMeteor
{
PROJECTILE
+RIPPER
Scale 20
Radius 16
Height 16
States
{
Spawn:
METE B 0 A_Explode(100, 300, 0)
METE B 1
loop
Death:
METE B 0 A_Stop
METE B 0 A_Quake(7,10,0,1000,"misc/hugequake")
METE B 0 A_SpawnItemEx("BigMeteorSet",0,0,0,0,0)
stop
}
}
I am obviously doing something wrong, somewhere.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Gummywormz on October 12, 2011, 03:50:00 AM
I think actors can call acs stuff directly so try: http://zdoom.org/wiki/Radius_Quake (http://zdoom.org/wiki/Radius_Quake)
Title: Re: The "How do I make a weapon do that?" thread
Post by: DarkAura on October 12, 2011, 04:23:04 AM
Aura - Okay, let's see:
Code: [Select]
actor BigMeteor
{
PROJECTILE
+RIPPER
Scale 20
Radius 16
Height 16
States
{
Spawn:
METE B 0 A_Explode(100, 300, 0)
METE B 1
loop
Death:
METE B 0 A_Stop
METE B 0 ACS_Execute(1,0,0)
METE B 0 A_PlaySoundEx("misc/hugequake","Voice")
METE B 0 A_SpawnItemEx("BigMeteorSet",0,0,0,0,0)
stop
}
}
Code: [Select]
#include "zcommon.acs"
Script 1 OPEN
{
Radius_Quake(7,100,0,1000,2);
}
The "tid" marks a Map Spot placed at the center of the map.
Everytime the meteor hits, "P_StartScript: Unknown Script 1" pops up.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Gummywormz on October 12, 2011, 04:40:45 AM
Firstly the script type must be (void) in order for it to be called properly. Secondly, try it like this:

Code: [Select]
actor BigMeteor
{
PROJECTILE
+RIPPER
Scale 20
Radius 16
Height 16
States
{
Spawn:
METE B 0 A_Explode(100, 300, 0)
METE B 1
loop
Death:
METE B 0 A_Stop
METE B 0 A_PlaySoundEx("misc/hugequake","Voice")
METE B 0 Radius_Quake(7,100,0,1000,0)
METE B 0 A_SpawnItemEx("BigMeteorSet",0,0,0,0,0)
stop
}
}
Title: Re: The "How do I make a weapon do that?" thread
Post by: DarkAura on October 12, 2011, 04:55:18 AM
Aura - Still nothing...
Title: Re: The "How do I make a weapon do that?" thread
Post by: xColdxFusionx on October 12, 2011, 11:31:18 PM
Script 1 is usually reserved for map scripts. May I suggest using a different, higher script number? Perhaps 110 or so?
Title: Re: The "How do I make a weapon do that?" thread
Post by: TorchMan19 on October 21, 2011, 12:43:05 AM
How do i make a weapon fall down? Im working on Trap buster.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on October 21, 2011, 12:46:02 AM
Define "fall down."
Perhaps you just want -NOGRAVITY on your projectile.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Ukiyama on November 02, 2011, 05:32:21 PM
Alright, is there a way to give a inventory through a attack that gives itself to everyone on my team who is near the attack? Seems like one of my weapons can't seem to do it when I thought it could, stupid bots musta jumped and made me think it actually made it rise :(
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on November 19, 2011, 12:50:46 PM
Okay, I want to make a Rockman Cross X weapon but I need to know if it's possible. Can these 2 things be properly done? And if so, what should I do to do it?

1) After the projectile hits the player (not a wall or anything), I want it to spawn different projectile backwards that chases the player that fired it. Thing is, it HAS to only chase the attacker AND it must chase them properly, in a way that it can't miss unless they hide behind a wall or something.

2) That projectile that returns must heal the player when it hits them. Would I just make it spawn a +15 health pickup upon death?

It's okay. King Yamato has helped me now.
Title: Re: The "How do I make a weapon do that?" thread
Post by: OZX on November 19, 2011, 07:30:18 PM
I have a question:

What code do i need to make the hill(king of the hill mode.)?

I need to get some progress done, cause we need more then rageroboenza.
Title: Re: The "How do I make a weapon do that?" thread
Post by: ice on November 20, 2011, 11:12:00 PM
can't really help with those. This one might be simpler though, How do I make a explosive weapon that sends those hit by it, including the user, flying from it (ie. Doom 2's explosives) I'm making a weapon that can be used to rocket jump
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on December 03, 2011, 02:02:57 PM
Let's say I wanted to make a weapon that did this:

When the fire button is pressed, there is a short delay. If the fire button is not held during the delay, then the player fires an attack that gets fired and splits and does stuff. If the fire button IS held during the delay, the player unleashes loads of the same attack at high fire rate until the fire button is no longer help or the ammo runs out.

How would I do this?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on December 04, 2011, 03:21:21 AM
Hold state, most definitely.
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on December 04, 2011, 10:34:40 AM
I'm not very good with the hold states. Even when I duplicate other hold state weapons like mirror buster, it seems a lot like it's just a normal repeated weapon.
Nvm, I'm moving the hold thing to the altfire, as I'm scrapping the altfire sword idea.
Title: Re: The "How do I make a weapon do that?" thread
Post by: -Daiki-TheOni on December 07, 2011, 07:50:54 PM
I have a problem....¿Why my weapon is there?
Can someone help me? is PNG format and when I put in the sprites directory and I play....
the weapon is misframing (or out of position). :cry:
I,m using "Paint"......
I read the weapons template but I,m new in that (I dont have much idea of codes...)
Thanks for read.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Gummywormz on December 08, 2011, 12:33:52 AM
Edit the offsets.
Title: Re: The "How do I make a weapon do that?" thread
Post by: -Daiki-TheOni on December 08, 2011, 09:01:54 PM
Thank you for help me!
Title: Re: The "How do I make a weapon do that?" thread
Post by: DarkAura on December 22, 2011, 02:30:31 AM
What is the flag used in the Turbosphere that leaves the trail of the player using it and is it possible to use it on a weapon?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Ukiyama on December 22, 2011, 07:00:50 PM
I'm not 100 percent sure but I know the speed power up can cause a trail and you could probably make it not give any speed increase and still have the trail. http://zdoom.org/wiki/Classes:PowerSpeed (http://zdoom.org/wiki/Classes:PowerSpeed)
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on December 22, 2011, 07:44:36 PM
ACS. Yeah.

I want to learn ACS, especially after hearing it's not that bad (people say that because I can C++). I don't want to have to scour Doom Wiki every five seconds; I want to get a nice tutorial that covers all the bases and goes over more than just a handful of ACS actions.

Anyone know where I can get the crash course on Skulltag coding? :?
Title: Re: The "How do I make a weapon do that?" thread
Post by: TheBladeRoden on December 22, 2011, 10:29:45 PM
zDoom wiki is your friend
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on December 22, 2011, 10:34:48 PM
Quote from: "SmashBroPlusB"
I don't want to have to scour Doom Wiki every five seconds
Title: Re: The "How do I make a weapon do that?" thread
Post by: Ivory on December 22, 2011, 10:37:09 PM
Well get over it. Zdoom wiki is your best friend.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Lighjing on January 04, 2012, 12:21:57 AM
How would I go about making a shotgun weapon that returns a portion of the damage done as ammo?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on January 04, 2012, 12:27:02 AM
As if it uses a projectile-based thing, it can use XDeath and A_GivetoTarget to give the ammo type
Title: Re: The "How do I make a weapon do that?" thread
Post by: Lighjing on January 04, 2012, 12:58:20 AM
So I've gotten the regenerating ammo part finished, now how would I make the bullets it fire spread out in a random pattern?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on January 04, 2012, 03:05:38 AM
A_FireCustomMissile("MissileName",random(number,-number),blah, blah,blah) just horizontal

Or add +WEAPON.NOAUTOAIM and
A_FireCustomMissile("MissileName",random(number,-number),blah, blah,blah,0,random(number,-number))
for random vertical aiming too
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on January 08, 2012, 04:46:53 AM
not related to weapons but whatever

Is it possible to have a player "die" (complete with the "killer" getting a message and earning a frag), but come "back to life" shortly after dying? This means that the revived player will retain any weapons / items / etc they had before dying. It's not a simple respawn or anything.

Also, is it possible for a weapon to take a frag AWAY from its victim upon a successful kill?
Title: Re: The "How do I make a weapon do that?" thread
Post by: JaxOf7 on January 08, 2012, 07:29:57 AM
http://zdoom.org/wiki/Classes:Archvile
http://zdoom.org/wiki/Thing_Raise
Try these for the first thing.
I make no promises.

As for taking frags away, you could have the victim kill itself through a pain state.
Not going to question why you would actually want this of course.
Title: Re: The "How do I make a weapon do that?" thread
Post by: MusashiAA on January 08, 2012, 07:45:29 AM
Not that I'm working on any weapon coding, but...

Is it possible to make a weapon that acts like a 3D version of Radd Spencer's bionic arm? A weapon that sticks to any surface and allows the user to make very long jumps by attaching it to the ceiling and swing to the other side. Said swing would have a constant velocity and no decay, for accuracy purposes... I just want to know if it's possible, and where could someone start to work on it, if someone where to do so.
Title: Re: The "How do I make a weapon do that?" thread
Post by: JaxOf7 on January 08, 2012, 06:47:43 PM
Lego's MM8-10 pack's ThunderClawWep.
Title: Re: The "How do I make a weapon do that?" thread
Post by: ice on January 19, 2012, 11:07:04 PM
Not technicly a weapons but works like one

How do I make a infinite use item? Like say, use the item and you fire a shot, but the item stays and can be reused?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Gummywormz on January 19, 2012, 11:12:59 PM
At the end of the sequence put the word "fail" (without quotes). Or just give the same item at the end of the sequence.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on January 23, 2012, 10:12:33 PM
Invulnerability. *sigh*

I have no idea how Skulltag invulnerability works, but I want to make an effect where a player is immune to all forms of damage like Skull Barrier. God Mode doesn't protect you from certain things like Quick Beams or Gamma's fireball attack, but Skull Barrier DOES.

However, I also want the player to die from falling in a pit somewhere (you know, the whole "fell too far" schtick). IIRC both Skull Barrier AND God Mode prevent you from dying in pits, which is problematic since I want the "good" invuln from Skull.

I'm aware that this is probably very difficult (if not impossible) to do, but if you have ANY ideas AT ALL how I can accomplish such a feat, I'm all ears.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on January 23, 2012, 10:22:22 PM
My suggestion is to stare at Skull Barrier and Beat's coding.

If you use the "beat way" of activating something, you could deactivate your shield when you fall in a pit.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on January 23, 2012, 10:43:06 PM
I thought the Beat Call script was only on certain maps. Correct me if I'm wrong, but wouldn't certain stages therefore be unable to take the invulnerability away from you (as they lack Beat Call checkers in their pits)?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on January 23, 2012, 10:47:27 PM
Probably
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on January 23, 2012, 10:52:46 PM
Ah well, it's better than nothing. Thanks for the help, I'll go take a look at things.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Max on January 23, 2012, 11:08:04 PM
Pits deal "Falling" damage or something, so you could make a powerarmour that protects you from everything except that
Title: Re: The "How do I make a weapon do that?" thread
Post by: Beed28 on January 24, 2012, 12:07:42 AM
Skull Barrier used A_ChangeFlag to remove the SHOOTABLE flag from your character or something like that.

Also, Gamma's fireball didn't kill you in God Mode, although being squished flat by his feet did.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on January 24, 2012, 12:08:42 AM
The towers created by the fireballs do ripping damage to you in God Mode. They can kill you in a few hits.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Beed28 on January 24, 2012, 01:04:14 AM
Really? That didn't happen to me. The only things I knew that could kill you in God Mode were telefrags, Quickman's lasers, Metool Daddy and Gamma stepping on you.

Nowadays, I always type in "give lmsinvincible" (which removes the SHOOTABLE flag like Skull Barrier does, only it does not give it back again) as an extra precaution after activating God Mode.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on January 24, 2012, 03:18:15 PM
Alright, new question.

Does anyone know how to instantly stop a player's movement? Looking at Classes and such I noticed that all attacks that make the player "stop" actually make the player sort of slow down or skid to a halt instead of an instantaneous change to zero momentum. I also want to know how to "hold" this zero momentum for a period of time, because I know Super Arm instant-stops you when you pick up the block, yet you immediately start falling after lifting said block.

Hopefully this will be the last question for a while.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Max on January 24, 2012, 03:18:45 PM
A_Stop
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on January 24, 2012, 03:21:03 PM
DEEEEEEEERRRRRRRPPPPPPPPP

thanks bro :geek:
Title: Re: The "How do I make a weapon do that?" thread
Post by: Jennifer on January 27, 2012, 10:59:40 AM
Quote from: "SmashBroPlusB"
not related to weapons but whatever

Is it possible to have a player "die" (complete with the "killer" getting a message and earning a frag), but come "back to life" shortly after dying? This means that the revived player will retain any weapons / items / etc they had before dying. It's not a simple respawn or anything.

Also, is it possible for a weapon to take a frag AWAY from its victim upon a successful kill?

Just wondering, are you basing a weapon off of the Dead Ringer?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on January 27, 2012, 03:27:22 PM
Quote from: "On January 9th, SmashBroPlusB"
DEAD RINGER. :ugeek:

... Well, I was TRYING to do it anyway. It's just too darn complicated.
boy are you late to the party
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on February 22, 2012, 08:12:45 PM
nearly one-month bump

Does anyone know what causes Junk Shield to lag so badly? All I want from the weapon is the "turtle shelling" effect the sprites cause. Is there a way to duplicate the circular sprite motion without making so much lag? Again, I just want the effect; I don't need solid actors or ripping projectiles or anything players even have to interact with, for that matter.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on February 23, 2012, 01:48:49 AM
it spawns 3 actors every tic and loops, none of these actors are client-sided so that's why

about your whole Dead Ringer idea, there are ways to do that

easy way: ACS for the obituary, and set a "flag" on the weapon that will spawn an explosion from the player and give a powerinvis

This may of may not work but...hey I guess it's worth a shot
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on February 24, 2012, 10:09:47 PM
Sorry to double post, I have a question

How do I check next weapon button in ACS?

(I have been looking for BT_ or something...vague, I know...)
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on February 26, 2012, 11:28:32 AM
Me again.

I want to make my weapon move forward a bit, then stop, then home in on a player. So far it's just going forwards a bit then disappearing after about 2-3 seconds.
(click to show/hide)
Yeah I did sort of look at the King Yamato quick boomerang, but I can't exactly see what it is that I need to change.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on February 26, 2012, 05:00:09 PM
You need to have at least one tic of duration in the areas where you spawn things.

Alternatively, you could set the Death state to spawn the next object in the sequence.

If you set an XDeath state, then the standard Death state will only apply if the projectile doesn't hit a player.

It's how AquaGuts' charge Bubbler attack works, to prevent the infamous "Double Lead" problem of hitting twice.
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on February 26, 2012, 05:48:56 PM
Tried adding duration spawn frames and death states. Not working :/

Probably me doing it wrong again:
(click to show/hide)
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on March 01, 2012, 12:34:29 AM
Uh......is there a reason this tries to face the target? In this case it would either switch targets or it would face you.

Projectiles use the one who shot them as a target.

Then you use MStaffFX2 to follow? What the face?

But yea, I don't know how this would work...and I am afraid I misunderstood your problem...but you should rewrite that code, it seems a bit....unclean and it could easily be broken...

EDIT: Oh I see what your problem is, look at kamapause, you have stop
replace that with goto Death
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on March 01, 2012, 05:53:56 PM
Already changed that earlier, but it's not the problem right now. The problem with my weapon at the moment seems to be that after the Kamaitachiblade, it's not spawning the Kamapause. After about a second after firing it, the weapon disappears when it should stop in place (spawn kamapause), then after about half a second chase in on other players (spawn kamachaser).
(click to show/hide)
EDIT: Okay, the KamaChaser might not need to chase in on other players, as that might be OP and not exact to the original, but it still needs to fly into other players after stopping.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on March 26, 2012, 03:07:34 PM
Is it possible to make a player's skin change when they switch weapons or have a certain weapon equipped, but unless this weapon is equipped the skin cannot be selected?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on March 26, 2012, 06:45:00 PM
Yes...in a way.

Jaxof7 created a weapon that made the player invisible and then spawned a ton of actors (client-sided actors) that made the player look like a bat. Note that these spawns would have to be on every tic.

A_SpawnItemEx("NewPlayerSkin",0,0,0,momx,momy,momz,0,SXF_ABSOLUTEMOMENTUM)

and invisiblity via A_SetTranslucent.

But...it would be so much easier to just change the player class., as then you could change the see and missile states.

EDIT: You COULD make fake see/missile/pain states on the weapon with some ACS trickery.

EDITEDIT: If you use the player class means, just give an inventory flag and change states via A_JumpIfInventory.
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on March 26, 2012, 07:43:51 PM
I have a weapon here that isn't displaying the HUD correctly. When the weapon is at full charge, it stays in one of the HUD frames and not the other, no matter what I do. Strange thing is that it still changes the player colour.
(click to show/hide)
I also still need help with that Kama Itachi. All I know is that it's not spawning the next projectile.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on March 26, 2012, 08:00:51 PM
Hey SevenTwelve, try taking a look at Awesome Network's Yo-Yo. The weapon comes to a stop before reversing its direction, whereas your weapon apparently needs to stop before homing in on someone (correct me if I'm wrong). I'm pretty sure you can take a look at how Yo-Yo works and put in your homing projectiles where you need 'em.

Also thanks for the tip Lego, I'll try that out and see how it works.
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on March 26, 2012, 08:43:48 PM
Tried tweaking around with the coding and the spawn states and stuff, but still no luck. Every time I try it does the same 'disappear after a bit instead of stopping and chasing after others.

Here's what I have at the moment:
(click to show/hide)
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on March 26, 2012, 09:32:56 PM
Try this

Quote
Code: [Select]
actor Kamaitachiblade
{
PROJECTILE
+DONTBLAST
Radius 6
Height 5
scale 2.5
damage (17)
+FORCEXYBILLBOARD
damagetype "Kama"
speed 32
States
{
Spawn:
KAMA ABIJA 2
KAMA B 2 A_SpawnItemEx("KamaPause",0,0,0,0)
stop
Death:
TNT1 A 1
stop
}
}

actor KamaPause : MageStaffFX2
{
PROJECTILE
+DONTBLAST
+LOOKALLAROUND
Radius 6
Height 5
scale 2.5
damage (19)
+FORCEXYBILLBOARD
damagetype "Kama"
speed 0
States
{
Spawn:
KAMA JABIJ 2 A_MStaffTrack
KAMA A 2 A_SpawnItemEx("KamaChaser",0,0,0,37)
stop
Death:
TNT1 A 1
stop
}
}

actor KamaChaser //: MageStaffFX2
{
PROJECTILE
+DONTBLAST
-EXTREMEDEATH
+LOOKALLAROUND
Radius 6
Height 5
scale 2.5
damage (22)
+FORCEXYBILLBOARD
damagetype "Kama"
speed 37
States
{
Spawn:
KAMA BIJA 2
KAMA A 0
loop
}
}
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on March 27, 2012, 12:15:26 AM
retarded as fuck question

how do I make a weapon draw other players towards me
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on March 27, 2012, 12:20:25 AM
The eternal question

I have been trying to do that without ACS, but I think Jax might know a way with his ACS wizardry....
Title: Re: The "How do I make a weapon do that?" thread
Post by: HD_ on March 27, 2012, 12:53:39 AM
Something Tsuki told me...

[8:44:37 PM] Tsukiyomaru Zero: hm, actually it would be possible by inverting what the current magnet pull (read: "Push") does
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on March 27, 2012, 12:56:21 AM
I can confirm Jax knowing how to make a pulling thing, yeah.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on March 27, 2012, 08:16:15 PM
Two questions. One is for GvH worker guys, and the other is for anyone else.

First, the general request: Is it possible to have multiple homing weapons "lock on" to the same target? As in, could I define a player that several projectiles will then home in on? Alternatively (and possibly easier) is there a way to have things track in on an actor that I can just spawn at the target's position?

Second, the specifics: While taking apart the GvH wad I found that script 302, which is responsible for the Cyborg's directional input system, has several "ThrustThing" actions all over the place. For Rainbow Drill Man I didn't mind so much, but for the current project of mine I want to be able to recognize button presses without having to move the player extra amounts. Do these ThrustThing actions have any effect on the player, or are they harmless? Can I remove / replace them without breaking the script?

For reference I included the script in question inside this spoiler to save space.
(click to show/hide)
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on March 27, 2012, 09:24:28 PM
They move the player based on the direction that they are facing

ThrustThing(GetActorAngle...)

thrusts the player based on the angle they are facing, like I said, there are + numbers to change the direction thrusted

whoever made the script originaly was lazy and put the thrust thing in the script as opposed to on the weapon
For your "smash brothers" based class, I recommend it be removed

Also, I think this script is also in CSCC, but I am not entirely sure as I have not looked at the ACS in that thing in a while.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on March 28, 2012, 02:01:36 PM
Thanks for the info, Lego. To my knowledge the script appears to be GvH-centric, as the latest public release of CSCC lacks the script, and other projects also don't have it. The directional input system works fine now, and just for compatibility's sake I changed the number to script 306. (I hope that doesn't cause any other problems...)

Also, I haven't found a solution to my first question yet, so here it is again.
Quote from: "SmashBroPlusB"
Is it possible to have multiple homing weapons "lock on" to the same target? As in, could I define a player that several projectiles will then home in on? Alternatively (and possibly easier) is there a way to have things track in on an actor that I can just spawn at the target's position?
EDIT: After looking at the ZDoom wiki I thought of a possible third way, where an invisible projectile that locks onto a target then spawns multiple projectiles that share the parent's target. Is it possible to "pass" targets to other projectiles, and how would I go about doing so?
Title: Re: The "How do I make a weapon do that?" thread
Post by: JaxOf7 on March 28, 2012, 09:10:24 PM
Quote from: "SmashBroPlusB"
Quote from: "SmashBroPlusB"
Is it possible to have multiple homing weapons "lock on" to the same target? As in, could I define a player that several projectiles will then home in on? Alternatively (and possibly easier) is there a way to have things track in on an actor that I can just spawn at the target's position?
EDIT: After looking at the ZDoom wiki I thought of a possible third way, where an invisible projectile that locks onto a target then spawns multiple projectiles that share the parent's target. Is it possible to "pass" targets to other projectiles, and how would I go about doing so?
Locking onto targets, eh? (http://cutstuff.net/forum/viewtopic.php?f=28&t=2158&start=80)
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on March 29, 2012, 01:10:10 AM
Funny story, actually... I had your Homing Sniper in mind when asking the question! Even though your weapon is VERY nice (and even includes a handy targeting reticule), it's still very possible to "lock on" to two separate players and have the barrage of missiles "spread" between the two enemies.

After playing with the weapon a bit more since then, however, I noticed that there was a slight delay in-between acquiring targets. If I were to remove the ability to create a second targeting reticule, would all of the projectiles then home in only on the player with the lock-on?


Also, new question. (I swear this will be the last one from me for a good while!) While looking at CSCC I noticed that a lot of flags and items which trigger certain attacks are given to and taken from players in the target's pain states. Is it possible to instead give and take items from a player when their projectile hits a target (in other words, doing so in the projectile's death states) rather than waiting until the target's pain state is triggered?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on March 29, 2012, 03:02:02 AM
Jax taught me this one.
A_GiveToTarget (http://zdoom.org/wiki/A_GiveToTarget)
Title: Re: The "How do I make a weapon do that?" thread
Post by: JaxOf7 on March 29, 2012, 04:11:49 AM
A little clarification.

Decorate's Target pointer (A_FaceTarget, A_TakeFromTarget, etc) is still the firer of the projectile.

Homing Sniper uses an inventory called TargetID to directly record an unlucky player's TID number (1000 - 1031).
During charge up, it uses actors to give TargetIDs to the using player, and when fired, these TargetID inventories are transfered to the respective projectiles (by them using SetActivatorToTarget() in their script, which is the firer).

So to answer your question, you can fire a thousand missiles at one dude. Hell, TargetIDs aren't even taken from the player until he's given "missilesFired" and the homingLocker does it.
You can indeed restrict locking on to one dude by checking that the using player has locked on and then restricting target search.
And the reason the homing sniper even has a delay on multiple locks on a single victim is because of an item given to them at the time of initial locking on.


As for final question, you may have to clarify whether you mean the firer of the missile or who the missile was locked onto.
Either one is yes. You can also run a distance check to the locked onto person to help make sure the missile actually hit them and not a Turbo road cone or something.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on March 29, 2012, 08:29:18 PM
I noticed your Homing Sniper scripts have a "is this actor a player or bot" check included in them. Could I just put that check somewhere instead of running a distance test?

Also, I wanted the attacker to be given an item if the projectile connected, not the target. One of my class's attacks gains ammo only by hitting enemies with other attacks, so I wanted to give a certain ammo type to the player when their hits successfully land.

Is it possible to change things like ammo or flags based on health values, though? It would be neat if the class lost ammo corresponding to the amount of damage he takes.


EDIT: I keep asking questions aaaaaaaaaaaaahhhhhhhh I'm such a bad person

but I was wondering if an actor could take away an item (like ammo) from the person who summoned it even if it has a different target. Connecting with my earlier question, I wanted the player to be able to spawn an actor similar to the Tsuki Sentry or the Gemini Man clones. This actor would beam in, fire an attack, and subsequently beam out... actually, I guess that makes it more similar to Treble Sentry. Anyway, if the summoned actor's attack were to connect, I want it to take ammo away just like if the player himself had connected with the attack instead. For example, if one of Treble Sentry's bullets were to hit something, some ammo would be taken away from the player who spawned it.

Does that make sense? :?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on March 29, 2012, 09:50:17 PM
Quote from: "SmashBroPlusB"
Also, I wanted the attacker to be given an item if the projectile connected, not the target. One of my class's attacks gains ammo only by hitting enemies with other attacks, so I wanted to give a certain ammo type to the player when their hits successfully land.

I suggest looking at Mess's class in CSCC.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on March 30, 2012, 10:59:45 AM
Thanks Korby, I forgot all about Messatsu's Super Meter!

Another absurdly stupid question: how do I print numbers in the HUD? Doom uses numbers for things like health and ammo and even uses special fonts for them, but MM8BDM is a game of energy meters and as such probably doesn't include that stuff. Nevermind I was being retarded (http://zdoom.org/wiki/DrawNumber)

still want that "Treble using ammo on hit" though
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on March 30, 2012, 05:36:25 PM
geez I hate double posting

Is it possible to have multiple weapons use the same HUD information if they all inherit from the same parent weapon?
Or do I have to define separate HUD sequences for each weapon?

Also, how do I make a graphic appear on-screen when a certain action is executed (such as using a certain item or firing a weapon)?
I wanted the "Meteo Bomb" graphic I posted in the CSCC thread to appear when my class uses the attack of the same name.
Quote from: "SmashBroPlusB"
still want that "Treble using ammo on hit" though
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on March 30, 2012, 08:36:47 PM
Have you considered looking at Flash Stopper?

The treble thing could probably be done with lots of flags and almost definitely in some smoother way I don't know of.
Title: Re: The "How do I make a weapon do that?" thread
Post by: xColdxFusionx on March 30, 2012, 09:27:09 PM
Quote from: "SmashBroPlusB"
Is it possible to have multiple weapons use the same HUD information if they all inherit from the same parent weapon?
Or do I have to define separate HUD sequences for each weapon?

SBARINFO does not transfer over with parenting, sadly. ...At least, I don't think it does...

Quote from: "SmashBroPlusB"
Also, how do I make a graphic appear on-screen when a certain action is executed (such as using a certain item or firing a weapon)?
I wanted the "Meteo Bomb" graphic I posted in the CSCC thread to appear when my class uses the attack of the same name.

Wait, do you mean on your screen only or on everyone's?

Yours: A_GunFlash and Flash state.
Everyone's: ACS trickery. See Korby's suggestion.
Title: hopefully once I learn things I'll stop asking questions
Post by: Hallan Parva on March 30, 2012, 10:09:57 PM
I must be reading the wrong thing, because the A_GunFlash page (http://zdoom.org/wiki/A_GunFlash) only talks about changing the player's appearance and in a third-person view. I want the graphic to appear on the player's screen when they use a certain attack or a certain inventory item.

And yes, I only want it for the triggering player. It would be rather silly to have "METEO BOMB" appear on everyone's screen every ten seconds or so.

I also want to take a bit of time here and thank everyone for their (repeated) assistance. I really appreciate all the help!
Title: Re: hopefully once I learn things I'll stop asking questions
Post by: xColdxFusionx on March 30, 2012, 11:54:07 PM
Quote from: "SmashBroPlusB"
I must be reading the wrong thing, because the A_GunFlash page (http://zdoom.org/wiki/A_GunFlash) only talks about changing the player's appearance and in a third-person view. I want the graphic to appear on the player's screen when they use a certain attack or a certain inventory item.

And yes, I only want it for the triggering player. It would be rather silly to have "METEO BOMB" appear on everyone's screen every ten seconds or so.

I also want to take a bit of time here and thank everyone for their (repeated) assistance. I really appreciate all the help!

Breve and IG!CMM use A_GunFlash and it doesn't alter their chasecam appearance.

Quote from: "Zdoom Wiki"
You can make your own muzzleflash sprites which, as long as the offsets are correct, will be overlayed when the gun is fired, making only that part of the gun visible when fires in pitch darkness. If this isn't an option, you can simply use TNT1A0.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on March 31, 2012, 01:04:28 AM
So let me get this straight... the A_GunFlash action can run a sequence which displays the sprite in the HUD simultaneously while the weapon fires and it won't change your chasecam appearance?

If I look at Breve and IG Mikey hard enough will I learn how to do this?
Title: Re: The "How do I make a weapon do that?" thread
Post by: xColdxFusionx on March 31, 2012, 01:09:50 AM
Quote from: "SmashBroPlusB"
So let me get this straight... the A_GunFlash action can run a sequence which displays the sprite in the HUD simultaneously while the weapon fires and it won't change your chasecam appearance?

If I look at Breve and IG Mikey hard enough will I learn how to do this?

Probably. I'll give you the short version here:

When you call A_GunFlash, whatever animation you put in the Flash state will be played over the weapon sprites, assuming it's aligned properly. States jumped to from the Flash state will have the same property.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on March 31, 2012, 01:11:43 AM
waitwaitwaitwaitwait

so I can have OTHER states do that too!?

look out CSCC 'cause here comes the Assistmobile



okay another question (I must be getting annoying by now)

AwNet's Hub Style class has an attack that changes damage output based on health... but it does it in a rather awkward way, as it uses 60 different projectiles with varying damage values. Is there a way to do something like Hub's Counter-Attack but using ammo values instead? What I'm asking is this: if I relied on ammo to output damage, could I avoid the trouble of making tons of duplicate projectiles? Or do I have to repeat Hub's headache?
Title: Re: The "How do I make a weapon do that?" thread
Post by: xColdxFusionx on March 31, 2012, 01:18:34 AM
Quote from: "SmashBroPlusB"
AwNet's Hub Style class has an attack that changes damage output based on health... but it does it in a rather awkward way, as it uses 60 different projectiles with varying damage values. Is there a way to do something like Hub's Counter-Attack but using ammo values instead? What I'm asking is this: if I relied on ammo to output damage, could I avoid the trouble of making tons of duplicate projectiles? Or do I have to repeat Hub's headache?

If you could, it would require some science with A_CheckTargetInventory in the damage value spot, but I'm not sure how successful such science would be.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on March 31, 2012, 03:55:50 AM
It's not that hard to make a billion of the same projectile. Just parent them off the same thing and change the damage, it doesn't take that long.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on April 01, 2012, 01:30:14 AM
well yeah, since I had to do that for Hub Style

but it would be REALLY nice if I didn't have to do that

especially since that means making 200 copies of the same attack

for five different attacks

 :ugeek:  :ugeek:  :ugeek:  :ugeek:  :ugeek:
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on April 01, 2012, 02:27:53 PM
gosh I hate double posting

but it looks like you can put functions inside of Damage TO AN EXTENT
Quote from: "ZDoom wiki's Actor Properties page"
Damage value

For a projectile defines the damage it inflicts upon impact.
The formula is random(1,8)*damage or random(1,4)*damage if STRIFEDAMAGE flag is set.
This also defines the damage for actors which attack like the Lost Soul. The formula for this is random(1,8)*damage.
damage is also used to define how many bullets are fired by the generic hitscan attack function A_BulletAttack.
Custom damage formulas can be specified by enclosing the value completely within parenthesis. For example: "damage (random(4,8)*5+6)". This bypasses the normal calculation and does the exact damage resulting from the custom formula.
Quote from: "ZDoom wiki's Random page"
int Random (int min, int max)

Usage
Returns a random integer between min and max (inclusive).
To me it looks like the Random command is a function. Are ACS scripts also functions? Or, is there a function that checks how much of a certain item the firing player is holding?
Title: Re: The "How do I make a weapon do that?" thread
Post by: xColdxFusionx on April 01, 2012, 02:34:07 PM
Watch and learn, my friend. Watch and learn. (http://zdoom.org/wiki/CheckInventory)

Although I'm not 100% sure it would work, it's worth a shot.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on April 02, 2012, 09:18:34 AM
Quote from: "ZDoom wiki's CheckInventory page"
int CheckInventory(str inventory_item);

Usage
Checks the inventory of the actor who activated the script for the item specified by inventory_item.
What if I'm spawning a projectile off of another projectile, like an explosion when an object detonates?
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on April 02, 2012, 03:36:09 PM
(click to show/hide)
Thanks! That seems to work now! I've had to change the speed to 1, otherwise it wont aim at other players, and still, I wish I could make it do so better (like how Quickman's boomerangs did). Still, it's good for now.

Still having trouble with this problem though.
(click to show/hide)
No matter what I do, it always stays in the F hud frame when full charged, yet still flashes between the player colours like it should.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on April 02, 2012, 06:39:54 PM
Have you checked to see TRLLG isn't messed up?
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on April 02, 2012, 06:46:43 PM
I've tried switching it to others such as A, yet it still doesn't show up.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on April 02, 2012, 06:58:41 PM
Have you tried changing the previous F to a G to test?
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on April 02, 2012, 07:54:37 PM
Not working. Still using the F frame.

Oddly enough, even setting all 3 of them to G makes the F frame appear. Is it something to do with that gunflash? Wild coil template, y u do dis?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on April 02, 2012, 08:06:56 PM
GunFlash? Why would you need that? When I made my first charging weapon I didn't even know such a thing existed!

Try taking a look at AwNet's busters, as none of them use GunFlash and there are three different charge types to choose from.

I'd try setting any actions to zero-length frames and have the animations perform no other actions.
Title: Re: The "How do I make a weapon do that?" thread
Post by: xColdxFusionx on April 03, 2012, 08:41:46 PM
Quote from: "SmashBroPlusB"
Quote from: "ZDoom wiki's CheckInventory page"
int CheckInventory(str inventory_item);

Usage
Checks the inventory of the actor who activated the script for the item specified by inventory_item.
What if I'm spawning a projectile off of another projectile, like an explosion when an object detonates?

I'm not sure how that would work. You'd probably have to do some shenanigans with giving projectiles items.
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on April 09, 2012, 08:00:14 PM
Solved it with the magical TNT1 frame being the gunflash. Glad that that's over.

Something that's been bugging me for awhile:

Poison damage. How do I use it?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on April 09, 2012, 08:03:48 PM
Wily Capsule 7 does it, why don't you look at that?
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on April 09, 2012, 08:07:48 PM
You mean through custom pain states? Wouldn't that cause a suicide if I did it that way?

The zdoom wiki has poison damage on it, which is basically what I need. I just have no idea on how to use this.
Quote from: "The ZDoom Wiki"
PoisonDamage value[, duration[, period]]
Gives a projectile poison damage. Poison damage isn't inflicted all at once but affects the victim for a certain amount of time. The value specified here defines the time the poisoning effect lasts. Remember, poison damage only affects players if only value is specified. Otherwise, it also affects enemies.
Poison damage is inflicted every period tics (the default value of 0 means once per second). If a non-zero duration is given, it is used for the total length of the poisoning, otherwise the length depends on the value.
(Putting it with the regular damage damage doesn't work)
Title: Re: The "How do I make a weapon do that?" thread
Post by: Gummywormz on April 09, 2012, 11:46:55 PM
You have to redefine the player class and change +NOBLOOD to +NOBLOODDECALS. It's not worth it though, as even that poison still makes the player suicide instead of earning you a frag.
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on April 10, 2012, 12:12:14 PM
Awww, that's a shame. I was hoping I could go back and give Toxic Burst poison damage but yeah. I'll try finding a way in the pain state, but I'll have to make it not kill the player. (I think I know how, so I should be okay)
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on April 11, 2012, 04:06:24 PM
Messatsu made a burning damage thing that worked for frags to the one who burned them, not sure how, though
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on April 11, 2012, 05:10:09 PM
Before I go ahead and think up even more weapons that require similar things to that Quickman's Kama Itachi I was making, is it actually possible to make weapons chase in on other players like how the Wily Capsule did it? When I get round to making Jolt Leader and any other weapons with similar behavior, I don't want to be stumbling for ages again.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on April 12, 2012, 03:27:30 PM
Not really a weapon question but it's still actor related.

Is it possible to turn off (and subsequently turn on again) a bot's chat capabilities? I don't want the SmashBro bot running his mouth while EX Mode is active since it just wastes the powerup's time frame.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on April 13, 2012, 02:40:50 PM
Well...honestly, i don't know, my guess would be to use acs to mute bots. but without botscript compiling, there would be no way to...

maybe acs...
Title: Re: The "How do I make a weapon do that?" thread
Post by: ice on April 16, 2012, 01:04:37 PM
If it possible to force a player to crouch via altfire? (has an idea for original stage mode)
Title: Re: The "How do I make a weapon do that?" thread
Post by: -FiniteZero- on April 25, 2012, 09:32:37 PM
I'm trying to make a weapon that has a seperate attack for when the user is at full health, but only at full health. How would I go about trying this?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on April 25, 2012, 09:37:32 PM
Stare at AwNet (http://www.cutstuff.net/forum/viewtopic.php?f=28&t=3135)'s Hub Style charge attack.

He has a different attack for EVERY health amount, actually. I'm sure it will be more than helpful.
Title: Re: The "How do I make a weapon do that?" thread
Post by: -FiniteZero- on April 25, 2012, 09:38:01 PM
Quote from: "SmashBroPlusB"
Stare at AwNet's Hub Style charge attack.

He has a different attack for EVERY health amount, actually. I'm sure it will be more than helpful.

Ah, I'll do that, thanks.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Jakeinator on May 06, 2012, 04:24:31 AM
Sorry if this is considered  a bump but how do i make a weapon that has a projectile go out a bit then split into 3 like the chameleon sting from X1?
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on May 06, 2012, 09:30:38 AM
Make the spawn state for the projectile only last about half a second (remember, 1 second=35 tics) and then make it spawn three new projectiles at different angles. Use the A_SpawnItemEx code found in other weapons and change the last value to the angle.

Here's everything about A_SpawnItemEx (http://zdoom.org/wiki/A_SpawnItemEx)

Remember that the new projectiles have to be different ones to the first one, otherwise you'll get a huge storm of whatever it is you're firing.
Title: Re: The "How do I make a weapon do that?" thread
Post by: xColdxFusionx on May 06, 2012, 07:22:28 PM
@Eon_and_Rush: Better Idea. (http://zdoom.org/wiki/A_CustomMissile)
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on May 09, 2012, 05:30:03 PM
This is sort of cheating I know, but I really need to add something to a class that I'm making in order to make it interesting.

Is there a way to make the player have really low traction control like in the "Icy Terrain" chaos generator effect? I want the class have slow acceleration, speed up to go really fast and then find it really hard to slow down, just like that effect. I can't do the thing that chaos generator did because that uses setsector effects, not inventory items.
Title: Re: The "How do I make a weapon do that?" thread
Post by: JaxOf7 on May 09, 2012, 10:22:28 PM
Try to use thrustthing in combination with momx and momy.

actor Slipping : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
States
{
Spawn:
TNT1 A 0
stop
Pickup:
TNT1 A 0
TNT1 A 0 ThrustThing(0, momx*0.5, 1, 0)
TNT1 A 0 ThrustThing(64, momy*0.5, 1, 0)
stop
}
}
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on May 09, 2012, 11:39:03 PM
Uh....That will make the player go in directions independent of the direction they are facing.
You need to use angle and angle+64
Title: Re: The "How do I make a weapon do that?" thread
Post by: ice on May 10, 2012, 01:52:46 AM
Quote from: "ice"
If it possible to force a player to crouch via altfire? (has an idea for original stage mode)
*never answered*
Title: Re: The "How do I make a weapon do that?" thread
Post by: xColdxFusionx on May 10, 2012, 01:59:12 AM
Quote from: "ice"
Quote from: "ice"
If it possible to force a player to crouch via altfire? (has an idea for original stage mode)
*never answered*

...This has to do with slide doesn't it.

Short answer: No idea
Long answer: There was an experiment with actor morphing at one point for a different mod, but I'm not sure if that would work well with what you're trying to do.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on May 10, 2012, 02:34:44 PM
Uh...morphing would not be the best idea for that one...as it would stop the player entirely for about a second...
Not to mention it would be cheap because without knowledge of ACS, the health would just refill entirely anyway.
Title:
Post by: DarkAura on May 26, 2012, 09:29:54 PM
Bumping as usual.
(click to show/hide)
When charging the weapon, the player immediately stops charging and executes it's standing/walking frames like it wasn't charging. The HUD will still appear charging, playing the charge sound effect, and the ACS for changing the player's colors still function. However, the one ACS_Execute in the last 3 make the player the standard MegaBuster colors intead of the original SuperAdaptor color.

The "RouletteSoundCheck" is set up so that the sound is supposed to play every three cycles, but does not.

Since I know minimal about making sophistocated weaponry such as this, I've no clue how to bludgeon it into working.

"Any idea what i did wrong...besides everything?"
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on May 27, 2012, 04:46:45 AM
I don't have an answer right now, but I just wanted to stop by and say how much I love you right now. :p


I'll take an in-depth look a little later.
Title: Re: The "How do I make a weapon do that?" thread
Post by: DarkAura on June 01, 2012, 03:41:31 AM
And I am back here again.

Is it possible to make it so a "consumable" item such as Tango and the Rush items cannot be picked up if that person has a specific item/flag in his inventory?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Ukiyama on June 01, 2012, 04:15:49 AM
Since copy wep classes can do it in Class mods I dont see why not, spoiler has example


(click to show/hide)
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hilman170499 on June 02, 2012, 11:52:30 PM
You know weapons that spread in 3 directions. How do you do that? (Not referring to Thunder Beam) I also want to know how to make chargeable weapons.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on June 03, 2012, 05:37:51 AM
Chargeable weapons are not hard they're just confusing, I will not explain them here...

But shots can be fired at any angle

A_FireCustomMissile("MissileName", angle[indegrees], useammo[1 for yes, 0 for no], spawn horizontal[8BDM usually uses 8], spawn height[usually 0])
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hilman170499 on June 03, 2012, 04:02:09 PM
Thanks. At first, I did not understand some parts but I studied them through SlumpEd.
Title: Re: The "How do I make a weapon NOT do that?" thread
Post by: BiscuitSlash on June 03, 2012, 04:26:37 PM
Got a bit of a problem here. It's a charging weapon and it works similar to proto buster and another charging weapon I made, but there's a little problem. Whenever the player fires 2 normal shots quickly, the weapon seems to fault and stop working in a way that you can't do anything more until you die.
(click to show/hide)
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on June 03, 2012, 11:17:38 PM
Why do you have it jump to Hold instead of Noammo when they have no ammo? I don't know if that's causing any problems, but it seems kind of weird.
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on June 04, 2012, 11:13:53 AM
The original proto buster does the same thing. (This weapon doesn't use limited ammo and it charges up fine)
Title: Re: The "How do I make a weapon do that?" thread
Post by: DarkAura on June 08, 2012, 03:54:06 AM
Me again!

Is it possible to activate/deactivate Deathmatch settings (i.e. sv_keepfrags) through scripts?

Also this... (http://www.cutstuff.net/forum/viewtopic.php?f=28&t=2143&p=173473&hilit=Bumping#p173473)
Title: Re: The "How do I make a weapon do that?" thread
Post by: Gummywormz on June 08, 2012, 03:56:55 AM
ConsoleCommand("sv_keepfrags 1"); should do it.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Pikmin747 on June 16, 2012, 03:13:37 AM
How do I make A line of that launches players upwards, like wind storm?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on June 16, 2012, 04:19:31 AM
give the projectiles damagetype "Wind"
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on June 16, 2012, 01:03:03 PM
The command for such is ThrustThingZ...if you want it to happen upon damaging players, then you have to either re-write the playerclass or just use damagetype "wind"
Title: Re: The "How do I make a weapon do that?" thread
Post by: Pikmin747 on June 16, 2012, 01:57:40 PM
Thanks, Kirby and Lego.

Sorry to ask again, but how do you create weapons that drain health?
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on June 16, 2012, 03:38:35 PM
Drain health for the enemy or the weapon user?

If it's for the enemy, you'll need a custom painstate.

You have to make a replacement class file for megaman, including an extra painstate that includes "DamageThing([healthtotakeawayhere])" in there, along with the projectile having it's damagetype match the new painstate.

Not very reliable though. If they die through this health lose, they die from a suicide and they lose a frag instead of you gaining one.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Pikmin747 on June 16, 2012, 04:32:14 PM
Ok.
Thanks.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on June 16, 2012, 10:31:32 PM
How do I force a camera angle change?

Like, for example let's say I want to make a weapon that imitates Wang-Tang's "Spirit of the Dragon's Kick". During the attack, Wang-Tang zips around and kicks the living daylights out of the target while Japanese symbols are displayed on the screen. The camera is locked in front of the enemy and is independent of player movement.

It's in this video at 1:23...


Another example would be Zidane's EX Burst "Reverse Gaia", where the camera slowly rotates around the target (like in the Robot Master Wardrobe) as Zidane kicks the living daylights out of them. Again, the camera has independent control and isn't influenced by the movements of the two main actors (the user and the target).



Basically, I want the camera to temporarily float at a given location and be independent of player movement. I only want the user's camera to be affected (the target's camera changing would also be nice), so if for example SaviorSword were to walk up to Shmeckie kicking the living daylights out of me he could just keep going and ignore it instead of having his camera (and everyone else's on the server) being forcibly moved.

Is there a way to get this done? :?
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on June 18, 2012, 04:42:11 PM
Got a problem here with a weapon I'm trying to make. Once the weapon loses all it's ammo, it goes into it's NoAmmo state, which makes a sound effect, some visual effects and replaces your weapon. However, for some reason it isn't making a sound or spawning the visuals.
(click to show/hide)
Any reason why? It doesn't have anything to do with the ammo state not happening, as it still somewhat replaces the player's weapon.
Title: Re: The "How do I make a weapon do that?" thread
Post by: SmashTheEchidna on June 20, 2012, 12:33:23 PM
Not sure if this has been asked before or not, but is there a way for my weapon's alt.fire to light oil pits?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on June 20, 2012, 01:07:40 PM
v1a-v2c you just make the projectile use ACS_Execute(202,0)

I would recommend adding a thing that check how far away from the floor the projectile is before using that, though
Title: Re: The "How do I make a weapon do that?" thread
Post by: Pikmin747 on June 20, 2012, 02:09:11 PM
Quote from: "SmashTheEchidna"
Not sure if this has been asked before or not, but is there a way for my weapon's alt.fire to light oil pits?


Well, I recently looked at the coding for Flameman's oil pits and they light up because they receive contact with either:
Pain.Flame
Pain.Fire
Pain.FireSpin(I think if I can remember.)
Pain.Scorch
You can make your weapon's projectiles pain type Pain.Flame or any of the above. Or, you can edit the oil pits to ignite with your weapon's projectiles.
 
EDIT: Forget this, I've made a blatant mistake.
Title: Re: The "How do I make a weapon do that?" thread
Post by: SmashTheEchidna on June 20, 2012, 03:09:32 PM
Well I gave them the Flame damage-type, but nothing happened when I used it on the oil there. That's pretty much why I was asking.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on June 20, 2012, 08:16:51 PM
Quote from: "Lego"
v1a-v2c you just make the projectile use ACS_Execute(202,0)

I would recommend adding a thing that check how far away from the floor the projectile is before using that, though
Read all posts please <_>
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on June 20, 2012, 08:37:00 PM
I am a tortoise! (http://cutstuff.net/forum/viewtopic.php?p=176711#p176711)
Title: Re: The "How do I make a weapon do that?" thread
Post by: SmashTheEchidna on June 20, 2012, 10:31:13 PM
I did read the post.  :| I was just saying what I initially tried before coming here for help.

Anyway it worked. Thanks a bunch.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on June 20, 2012, 11:38:25 PM
Camera angles and such would all be controlled by ACS

using setActorAngle to change the angle of the camera and setactorpitch to change it's pitch. make sure the camera has a TID

the script would have to be executed by something like a line, an inventory item, or even the world.

you also would have to use camerachange or something
Title: Re: The "How do I make a weapon do that?" thread
Post by: Pikmin747 on June 25, 2012, 07:36:27 PM
This is not about a weapon but…

How can I force my bot to use my weapon?
Title: Re: The "How do I make a weapon do that?" thread
Post by: xColdxFusionx on June 25, 2012, 08:07:53 PM
Some sort of trickery with ACS/Decorate may be in order.

This may be of use to you. (http://zdoom.org/wiki/A_SelectWeapon)
Title: Re: The "How do I make a weapon do that?" thread
Post by: TheBladeRoden on June 26, 2012, 10:16:29 PM
I like to replace the instagib weapon with the weapon I want to test

Code: [Select]
script 997 ENTER
{
if(GetCvar("instagib")==1){
TakeInventory("MegaBuster",1);
GiveInventory("BallisticBuster",1);
GiveInventory("WTank",10);
}
}
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on June 27, 2012, 06:02:53 AM
Personally, I go into buckshot, freeze, and summon the weapon into him.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on June 27, 2012, 09:07:08 PM
How do you get an actor to "follow" a player around? I want to make the Snakelets for Mega Fortress Snake Man. Basically, you'd spawn in a Snakelet and it would follow you around and stuff, but it could leave your side to go hit someone real quick before it returns to you.

Also if there was a way to "count" the number of Snakelets you have that'd be great, so there could be some sort of limit.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Pikmin747 on June 27, 2012, 09:19:54 PM
Quote from: "xColdxFusionx"
Some sort of trickery with ACS/Decorate may be in order.

This may be of use to you. (http://zdoom.org/wiki/A_SelectWeapon)

Thank you all.
Title: Re: The "How do I make a weapon do that?" thread
Post by: SmashTheEchidna on July 14, 2012, 12:19:17 PM
An idea just randomly came to mind. This is probably waaay out of my range of capability, but...

Is it possible to make a melee type weapon for throwing enemies? Kirby's backdrop/suplex ability comes to mind for an example. (especially with the Kirby's Adventure expansion WIP) It'd be really interesting to see how that would work.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on July 14, 2012, 01:24:40 PM
Theoretically, yes, it is possible...

I'm guessing if you were to combine the scripts that Jax used for his class in CSCC and the Gemini Clone from former YD classes...

Of course, I have not looked at the scripts 100%, so I could be way wrong...
Title: Re: The "How do I make a weapon do that?" thread
Post by: SmashTheEchidna on July 14, 2012, 01:41:13 PM
Awesome. I was thinking about a throwing class for CSCC, or at least a class with a throwing ability. (though I already have a class in there so that may not happen.)
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on July 31, 2012, 10:23:20 PM
Is it possible to "carry" items within a player even after they die?

For example, let's say I made a version of Dark Man 1 whose buster increased in strength as you gain frags. However, the buster weakens upon death. This means that, if a player had a Level 4 Dark Man and then dies, they would respawn with a Level 3 Dark Man.

I'm aware that there's probably going to be some inventory flags needed. I just need to know if the game can "remember" a player's inventory after death.
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on August 03, 2012, 03:49:44 PM
Got a problem with a weapon so I am posting here for help.

(click to show/hide)
I want the weapon to make 2 explosions 4 times, each on different sides. However for some reason the explosions (A_Explode) don't seem to be doing anything. The only way I can attack people with this by shooting it directly at them which that is NOT want you're supposed to do. Why are these explosions not doing work?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on August 03, 2012, 06:54:26 PM
Might have something to do with your +NOINTERACTION.
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on August 03, 2012, 07:55:24 PM
Nop, still not working. I actually put that there thinking it would fix it but it didn't work.
Title: One Line of Code.... Korby
Post by: Korby on August 03, 2012, 11:23:10 PM
Code: [Select]
actor DSpearExplosion
{
PROJECTILE
+DONTBLAST
+DONTSPLASH
+NOINTERACTION
Radius 1
Height 1
DamageType "Destroy"
scale 2.5
damage (1)
speed 0
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Explode(15,96,0)
stop
}
}
Try this.
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on August 04, 2012, 11:06:04 AM
Yay! It's working now! Thanks again Korby!

Dammit I think I did a similar thing but changed it
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on August 04, 2012, 12:25:52 PM
Quote from: "SmashBroPlusB"
Is it possible to "carry" items within a player even after they die?

For example, let's say I made a version of Dark Man 1 whose buster increased in strength as you gain frags. However, the buster weakens upon death. This means that, if a player had a Level 4 Dark Man and then dies, they would respawn with a Level 3 Dark Man.

I'm aware that there's probably going to be some inventory flags needed. I just need to know if the game can "remember" a player's inventory after death.

Hm...This...might be a bit more of a challenge...there is no way to do it with purely DECORATE as far as I know, but you can use ACS to set variables to players so that they can be given it back upon respawn

Although, if it is a weapon and the mod is meant to be played in a campaign, then force the flag that makes players not lose weapons/inventory/keys on death
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on August 12, 2012, 08:13:06 PM
Is there a way to enable and disable a projectile from doing damage without having to spawn multiple actors? I want to make a projectile stop doing damage after a set amount of time but I need to keep spawning more projectiles to a minimum. And yes, there is a reason, which is why I'm saying that.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on August 12, 2012, 09:17:29 PM
have you tried having it spawn a single projectile after an amount of time that no longer does damage.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Ukiyama on August 13, 2012, 01:23:37 AM
Could always have a damager and after a certain number of frames you have a jump that skips the damager spawning
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on August 14, 2012, 06:41:32 PM
late response for the win
Quote from: "Lego"
Quote from: "SmashBroPlusB"
Is it possible to "carry" items within a player even after they die?

For example, let's say I made a version of Dark Man 1 whose buster increased in strength as you gain frags. However, the buster weakens upon death. This means that, if a player had a Level 4 Dark Man and then dies, they would respawn with a Level 3 Dark Man.

I'm aware that there's probably going to be some inventory flags needed. I just need to know if the game can "remember" a player's inventory after death.

Hm...This...might be a bit more of a challenge...there is no way to do it with purely DECORATE as far as I know, but you can use ACS to set variables to players so that they can be given it back upon respawn

Although, if it is a weapon and the mod is meant to be played in a campaign, then force the flag that makes players not lose weapons/inventory/keys on death
No, the idea's meant for Cutstuff Community Classes.

Basically there was going to be a class that would gain experience and "level up", making their attacks stronger, but the class would also "level down" upon death. I wanted a way to make the game remember what "level" the player had reached on death, and to make them respawn as a single level below what they had died as. Of course, this would be on a match-to-match basis, and the player's level would have to reset on a map change.

Even though this might not even happen anymore because they're stupid I'd still like to know how to do this for future reference. Hey, it might help me do something completely different in the future! (Which is the case for a few things I learned for AwNet being applied to other projects...)
Title: Re: The "How do I make a weapon do that?" thread
Post by: SmashTheEchidna on August 19, 2012, 05:52:29 AM
Is there a way to get a weapon to give out the "Impressive" and "Most Impressive" medals like Skulltag's Railgun does?
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on August 20, 2012, 05:20:16 PM
Quote from: "Ukiyama"
Could always have a damager and after a certain number of frames you have a jump that skips the damager spawning
Thanks Uki!

Another coding problem I have:
(click to show/hide)
When there is no longer ammo, the weapon is supposed to spawn two actors that fly out for extra effects. These don't show up though, and I can't figure out why. Also I want to give it some sort of translucency blinking effect, but I don't know how I would do that.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Ukiyama on August 21, 2012, 12:02:03 AM
Well since it is a projectile, chances are your hitting your own projectile when its spawning (could be the last tic of the shield hitting the effects as well). Try making them ripper or maybe even no interaction and have them have a smaller lifespan in order to get rid of them faster.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on August 26, 2012, 05:00:47 PM
this is a silly question and it's probably on the wiki but I can't find it


Can I return the number of frags the player currently has, so I can print it in a custom HUD or something? Also, how do I check for the number of lives the player has (and how do I check to see if lives are enabled in the first place)?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on August 26, 2012, 05:35:11 PM
in ACS
PlayerFrags()

as for lives...
Mess made up a very intricate way to do that by checking how often a player has died based on a death script, an array, and how many lives the server has set
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on August 26, 2012, 06:41:18 PM
Still can't get those shield pieces to show up. I think they might be spawning too low, despite the spawns being the same as the shield.
(click to show/hide)
Title: Re: The "How do I make a weapon do that?" thread
Post by: SmashTheEchidna on September 04, 2012, 11:43:35 AM
Quote from: "Gizmo The Cat"
Is there a way to get a weapon to give out the "Impressive" and "Most Impressive" medals like Skulltag's Railgun does?


Just because it seems like nobody noticed my question.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on September 04, 2012, 01:23:59 PM
Oddly enough...I think weapons that use A_RailAttack produces those medals, but nothing else does. I could be completely wrong, but I HAVE seen Impressive given by custom railguns
Title: Re: The "How do I make a weapon do that?" thread
Post by: SmashTheEchidna on September 04, 2012, 01:52:31 PM
Hm. I see. I wanna try messing around with that.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on September 07, 2012, 07:03:30 AM
Uh, how does Top Spin work exactly? I mean the actual "spinning" part. The weapon itself is a hopeless mess of checking states and ACS script calling, and I can't quite make heads or tails of it. Basically I want a weapon to slowly turn the player while it's being used; if it's possible to make rotation go faster or slower than Top Spin then that would be great. I'd also like to know of a way to reverse the direction, so I can make players spin counter-clockwise instead of clockwise like Top Spin does it.

Also, if Zandronum offers a better way to turn players, I'm all ears.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Laggy Blazko on September 07, 2012, 12:51:10 PM
http://zdoom.org/wiki/SetActorAngle (http://zdoom.org/wiki/SetActorAngle)
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on September 07, 2012, 05:00:20 PM
A_SetAngle and load it in Zandronum
It's the way of the future  :ugeek:
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on September 07, 2012, 05:35:45 PM
Quote from: "Michael712"
Still can't get those shield pieces to show up. I think they might be spawning too low, despite the spawns being the same as the shield.
(click to show/hide)
Still need help, and I have little time to finish this off.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hilman170499 on September 18, 2012, 02:56:20 AM
How do you make projectiles that travel a certain distance before de-spawning?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hilman170499 on September 21, 2012, 01:48:22 AM
Quote from: "ice"
Here's a script for my short range buster

Code: [Select]
actor OMegaShot
{
PROJECTILE
damagetype "Buster"
Speed 27
Damage (10)
radius 5
height 5
scale 2.5
States
{
Spawn:
BUST A 2
BUST A 0 A_JumpIfCloser(500,"Spawn")
goto Death
Death:
TNT1 A 0
stop
}
}

the way the script works, it checks if the shot is within 500 units, if it's closer than 500. it will keep going, but if it exceeds that distance, it dies

Thanks for the example.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on September 21, 2012, 03:10:06 AM
Well, that's one way to do it, but the way I did it with Torch Arm was just giving the state a finite duration
Like so
Code: [Select]
Spawn:
BUST A 6
stop

Also, with this setup the speed*number of tics = distance

So, if this was moving at a speed of 10, then the projectile would travel 60 map units away from the player.
Title: Because Morphball
Post by: MasterXman on October 07, 2012, 06:06:43 PM
Hope this isn't a bump
Is it possible to make a weapon that alters the Height and/or Speed of the player?
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on October 07, 2012, 06:09:31 PM
In what sort of way?

If you want it to push you into the air a bit, then use ThrustThingZ (http://zdoom.org/wiki/ThrustThingZ) within the firing state. If you want to run faster like holding 8BDM's scorch wheel, then you'll need to use acs. Look at the script that Scorch Wheel uses and go from there.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on October 08, 2012, 08:53:31 PM
Well, you can change the player height by morphing them, which can be achieved by either giving them a powermorph, hitting them with a morphprojectile, or just straight up using the Morph fuction in ACS.
However, morphing is unadvised if it can be called at will because it tends to stop the player cold and it is pretty much an instant refill on health
It also resets the thing ID (which is used for pretty much EVERYTHING in ACS...)

Speed, however could be changed with a simple script in ACS scorch wheel uses this setup with arguments and script like such
Code: [Select]
//Sets the player speed to 1.45 times normal, used scorch wheel
ACS_ExecuteAlways(191,0,1)
//Set player speed to normal
ACS_ExecuteAlways(191,0,0)

Alternatively, you could use this script in ACS.
Code: [Select]
//435 is just a placeholder, you can change it if you want.
script 435 (int factor)
{
SetActorProperty(0,APROP_SPEED,factor);
}

and in DECORATE you can simply change the player speed
Code: [Select]
ACS_ExecuteAlways(435,0,amount base speed is multiplied by)
But yea...there might be some number I'm missing in ACS script that I made there...but I don't know...
Title: Re: The "How do I make a weapon do that?" thread
Post by: JaxOf7 on October 08, 2012, 11:14:37 PM
Quote from: "Lego"
it is pretty much an instant refill on health
int i = GetActorProperty(0, APROP_HEALTH);
MorphActor(...);
(delay(1); might need to go here)
SetActorProperty(0,APROP_HEALTH,i);

Quote from: "Lego"
It also resets the thing ID (which is used for pretty much EVERYTHING in ACS...)
MRF_NEWTIDBEHAVIOUR
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on October 12, 2012, 05:19:48 AM
Extending from the topic of morphs, is it possible to execute a teleport and a morph at the same time? Or, even better, can I move a player while morphing them? Like, let's say I had a Captain America class that would "leave" when I "tag in" Viewtiful Joe. I've got most of the process down, and the idea's to have the actual "player" morph from the Captain to Joe while jumping forward a few map units. What others would see is Joe appearing in front of Captain America (spawned by an actor; at this point the player's already become Viewtiful) before the Captain leaps away. The problem is I want the process to flow smoothly, so I don't want (for example) Captain America suddenly jumping forward for a split-second before turning into Viewtiful Joe.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Gummywormz on November 13, 2012, 04:34:35 PM
Is there any way to make a spawned object visible only to the player that spawned it?
Title: Re: The "How do I make a weapon do that?" thread
Post by: tsukiyomaru0 on November 13, 2012, 09:32:46 PM
Quote from: "Gummywormz"
Is there any way to make a spawned object visible only to the player that spawned it?
I don't think so. I know there are ways to make it visible for a class(es) or a team(s), and of making "message on hud". But I suppose this is not what you want.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Jakeinator on November 22, 2012, 03:42:51 PM
I'm attempting to make a class, but i need to ask some questions

1.) How do i make a weapon use Altfire

2.)How do i make a AoE that stuns other players like spark shot?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hilman170499 on November 22, 2012, 04:39:20 PM
Quote from: "Eon_and_Rush"
I'm attempting to make a class, but i need to ask some questions

1.) How do i make a weapon use Altfire

2.)How do i make a AoE that stuns other players like spark shot?

1)Make a state called "AltFire". Altfires have their own hold sate called "AltHold".

Example from yours truly:
Code: [Select]
AltFire:
AltHold:
HWEP A 0 A_JumpIfInventory("HLaserClassAmmo",2,"RapidFire")
goto Ready+1
RapidFire:
HWEP A 0 A_JumpIfNoAmmo("NoAmmo")
HWEP A 0 A_TakeInventory("HLaserClassAmmo",2)
HWEP A 0 A_PlaySoundEx("weapon/mbuster","Weapon")
HWEP A 0 A_FireCustomMissile("HRapid",0,0,8,0)
HWEP BCD 2
HWEP D 0 A_PlaySoundEx("weapon/mbuster","Weapon")
HWEP D 0 A_FireCustomMissile("HRapid",0,0,8,0)
HWEP DDD 2
HWEP D 0 A_PlaySoundEx("weapon/mbuster","Weapon")
HWEP D 0 A_FireCustomMissile("HRapid",0,0,8,0)
HWEP DDD 2
HWEP D 0 A_Refire
Goto Ready+1

Just refer to the top part of that code and ignore the bottom. Make sure you put the Altfire state in the weapon actor.

2)
Code: [Select]
actor (Insert actor name here)
{
-SOLID
+NOGRAVITY
PROJECTILE
damage (0)
radius 1
height 1
damagetype "Shock" //This is the thing that stuns victims
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Explode(5, 450,0) //From left to right, the values in the brackets are; damage, radius, (some value I don't know)
stop
}
}
Title: Re: The "How do I make a weapon do that?" thread
Post by: Jakeinator on November 22, 2012, 05:14:41 PM
Thanks hil! Now i can finally make my class's first weapon!
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on November 24, 2012, 01:13:39 PM
How do I make a projectile bounce on floors but NOT walls? The game ceases to do work during the load up part if I use -BOUNCEONWALLS or just +BOUNCEONFLOORS, and I don't know what else I can do.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Balrog on November 24, 2012, 01:59:19 PM
You could try setting its BounceType to Classic, but that would make it an "MBF bouncer", and I'm not sure if that's what you want. I'm assuming that you want it to bounce off ceilings too, so you could also try giving it +BOUNCEONCEILINGS.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Jakeinator on November 25, 2012, 05:19:39 AM
Second question: How do i make ammo Regenerate like a class?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hilman170499 on November 25, 2012, 05:25:18 AM
Quote from: "Eon_and_Rush"
Second question: How do i make ammo Regenerate like a class?

Ammo regenration is very simple.

Example:

Code: [Select]
Ready:
HLSR C 0 ACS_ExecuteAlways(998,0,56)
HLSR C 1 A_GunFlash
HLSR C 8 A_WeaponReady
HLSR C 0 A_GiveInventory("HRapidClassAmmo",2) //How this works is that the weapon refills ammo if you are not firing for long enough. Make sure the ammo name matches the ammo type for the respective weapon.
Goto Ready+2
Title: Re: The "How do I make a weapon do that?" thread
Post by: TheBladeRoden on November 26, 2012, 05:27:55 AM
Is there a way to make a projectile go into a certain state when it bounces?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Zard1084 on December 02, 2012, 01:39:39 PM
Here is a question from me is it possible to make a weapon deal negative damage? because i have a idea for a Healing weapon but i want to know if its possible? *inb4 everyone tells me to look at plantbarrers coding*
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hilman170499 on December 02, 2012, 04:13:18 PM
Quote from: "Zard1084"
Here is a question from me is it possible to make a weapon deal negative damage? because i have a idea for a Healing weapon but i want to know if its possible? *inb4 everyone tells me to look at plantbarrers coding*

Here is the answer:

Code: [Select]
PLAA A 0 HealThing(8) //The "HealThing" action recovers the user's health. The number in brackets determines how much health is restored.
Title: Re: The "How do I make a weapon do that?" thread
Post by: BiscuitSlash on December 02, 2012, 04:15:15 PM
Actually, if you want it to heal another player, you'll have to make a custom painstate in a new classfile that uses that line which Hilman showed.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Zard1084 on December 02, 2012, 04:24:05 PM
Well that just hit me like a atomic fire shot to the face D:
I can try that but... i'm trying to make a healing only weapon for team games i'll have to use the megabuster as a base then for testing *hint: my new weapon hopefully will be the healing buster or healbomb for team matches*
Title: Re: The "How do I make a weapon do that?" thread
Post by: JaxOf7 on December 03, 2012, 07:24:21 AM
For anyone that didn't know, Classes-v6e PlantBarrierBoss heals allies in non-TLMS.
No true way to check whether a projectile or explosion hits allies, or know which ally it hit for sure. Best thing you can do is an ACS distance check to all players on the firer's team when the projectile enters xdeath or from the center of the heal radius.
Oh and also, be sure to pester the zandronum devs for A_RadiusGive.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Colonel ServBot on December 04, 2012, 08:34:39 PM
Well, I am working quite hardon the cacti lovers pack, so how do I keep the weapon projectile from spinning?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on December 04, 2012, 09:15:00 PM
Is it possible to deal damage to everyone on the map?

Also, can I make a weapon deal "damage" to a player's ammo instead of their health? What actions would I need to run, and on what states would I place them?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Gummywormz on December 04, 2012, 11:08:19 PM
Quote from: "SmashBroPlusB"
Is it possible to deal damage to everyone on the map?

Execute a script that does this (This probably won't count for frags.):

Code: [Select]
Script # (void)
{
for (int pd=1000; pd<1033; pd++) //might need to change 1033 to 1065 in v3 because 64 player support
{
Thing_Damage(pd,amount,0);
}
}

Quote from: "SmashBroPlusB"
Also, can I make a weapon deal "damage" to a player's ammo instead of their health? What actions would I need to run, and on what states would I place them?

Put a script in a custom painstate that calls A_TakeInventory for every ammo type. (Annoying, yes. You might be able to get away with just TakeInventory "Ammo".)
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on December 06, 2012, 02:22:26 AM
hey uh




So I want to make a player not be able to pick up any Health Capsules on the field...

How would I go about doing this?
Title: Re: The "How do I make a weapon do that?" thread
Post by: xColdxFusionx on December 06, 2012, 02:46:37 AM
Have you tried -PICKUP (http://zdoom.org/wiki/Actor_flags)? That might work.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on December 06, 2012, 02:53:17 AM
I think the Megabuster has an acs script that tells it to not pick up WE, you can probably use something similar to that for health.
Title: Re: The "How do I make a weapon do that?" thread
Post by: SmashTheEchidna on December 15, 2012, 06:13:31 AM
An idea just hit me upside the head.

Is it possible that you could alter the way a weapon fires depending on which of the arrow keys (or wasd, or whatever you use) you're holding? Like maybe, adding flags to the movement that affect the fire to make it do different things?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on December 15, 2012, 06:18:26 AM
look at Cyborg in GvH

he uses a directional input script for his air dash




actually that's the same script I recommended for Smash and his combo hits so I suggest you study it
Title: Re: The "How do I make a weapon do that?" thread
Post by: SmashTheEchidna on December 31, 2012, 09:56:05 PM
Quote from: "SmashBroPlusB"
look at Cyborg in GvH

he uses a directional input script for his air dash




actually that's the same script I recommended for Smash and his combo hits so I suggest you study it

Yeah, I definitely will, since this is exactly what I was asking for. I'll probably end up experimenting with both ideas once I get the hang of it.


EDIT: I might have asked this before, but how do you get a special obituary for when you kill yourself? (i.e "Player got reckless with his BFG10K)


DOUBLE EDIT: (Wow, am I really still the last person posting here?) Anyway, I was wondering about the Wire Adapter. I was wondering if the code could be used to made into a weapon type of thing, like the Hookshot? (I remember Lio trying that with his scorpion) Or at the very least, could it be edited to activate upon wall contact?

The wire adapter is cool, but everyone wants to be able to use a hookshot.

Seriously though, I'm just curious. I'm not actually gonna be MAKING anything out of this.
Title: Re: The "How do I make a weapon do that?" thread
Post by: xColdxFusionx on January 04, 2013, 07:56:26 PM
1.) I can't seem to find how to define suicide obituaries. I believe they're hard-coded into the engine for specific weapons, but if someone wants to prove me wrong on that they can go right ahead.

2.) I wouldn't be the one to tell you how to make an aimable hookshot, but I wouldn't doubt that it's possible. Hell, people have made aimable Portal Guns and telekinetic throws. A grappling hook can't be too hard to make if you put your mind to it.
Title: Re: The "How do I make a weapon do that?" thread
Post by: ice on January 04, 2013, 08:14:57 PM
Quote from: "Gizmo The Cat"
The wire adapter is cool, but everyone wants to be able to use a hookshot.

Seriously though, I'm just curious. I'm not actually gonna be MAKING anything out of this.


2 words, boomer kuwanger
Title: Re: The "How do I make a weapon do that?" thread
Post by: SmashTheEchidna on January 04, 2013, 09:53:22 PM
Actually I just remembered an item/weapon that I could give my CSCC class that fits the bill for this. Though I don't know if making another weapon wouldn't be a bit too much, though it could probably do actual damage rather than just hooking onto things.

Anyway, I haven't seen Boomer Kuwanger, or any of the MMX classes so I dunno.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Zard1084 on January 21, 2013, 12:06:06 PM
umm can you guys tell me how to make a projectile push people around like the tornado hold? i tryed ThrustThingZ and it did not work or am i doing it wrong? also its for a weapon called the "Knockbackbuster" i'm making it for a classes mod of mine.... Any tips?
Title: Re: The "How do I make a weapon do that?" thread
Post by: tsukiyomaru0 on January 21, 2013, 01:01:40 PM
Quote from: "Zard1084"
umm can you guys tell me how to make a projectile push people around like the tornado hold? i tryed ThrustThingZ and it did not work or am i doing it wrong? also its for a weapon called the "Knockbackbuster" i'm making it for a classes mod of mine.... Any tips?
Check what is the damagetype of Wind Storm, I think they changed all damage types. If anything, you can make the projectile have A_Blast or A_RadiusThrust with a very high strength value and small distance in its XDeath state.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Zard1084 on January 21, 2013, 01:03:47 PM
Nevermind that i got what i needed Tuski but thank you for telling me anyways
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on January 21, 2013, 10:17:48 PM
Quote from: "xColdxFusionx"
1.) I can't seem to find how to define suicide obituaries. I believe they're hard-coded into the engine for specific weapons, but if someone wants to prove me wrong on that they can go right ahead.
Hard-coded for specific damage types, actually. For example, the Marine's Fragmentation Grenade from GvH: 8BDM Edition uses the "Grenade" damage type, which is why it can display lines like "Marine tripped his own grenade" despite having a different name and functioning differently from the Doom version.

There are a few other suicide damage types out there but I can't remember 'em all.
Title: Re: The "How do I make a weapon do that?" thread
Post by: leoalex50 on January 22, 2013, 01:26:15 PM
how do i make my wep have spread?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on January 22, 2013, 10:22:13 PM
Well, if you're lazy, you could always give yourself a spreadrune. However, just add additional A_FireCustomMissile states to it that have adjusted angles that fit to your desired spread cone.
Title: Re: The "How do I make a weapon do that?" thread
Post by: leoalex50 on January 22, 2013, 11:21:18 PM
ty
Title: Re: The "How do I make a weapon do that?" thread
Post by: Zard1084 on January 26, 2013, 04:29:05 AM
Ok here is the deal... i have two weapons on a class but i want the class to only switch between the two weapons...
so can anyone help me fix this little issue of mine?
here is the codes...
(click to show/hide)
I have these codes in but the class can still switch to other weapons that was picked up. so can someone help me fix this?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on January 26, 2013, 05:08:26 AM
consider putting your a_selectweapon thing before a_lower
Title: Re: The "How do I make a weapon do that?" thread
Post by: Zard1084 on January 26, 2013, 05:30:54 AM
Quote from: "Korby"
consider putting your a_selectweapon thing before a_lower
Ahhh... ok i'll try that now..

Edit: Thanks Korby! That did the trick~
Title: Re: The "How do I make a weapon do that?" thread
Post by: HellHawkX on January 26, 2013, 10:37:39 AM
Ok guys, here is the REAL deal, I want to make Protoshield, but not like Protoupgrade, I want the player to be able to switch between weapons while still holding the shield, any idea on how to do this?
Title: Re: The "How do I make a weapon do that?" thread
Post by: fortegigasgospel on January 26, 2013, 11:13:05 AM
Quote from: "kyuubinaruto9990"
Ok guys, here is the REAL deal, I want to make Protoshield, but not like Protoupgrade, I want the player to be able to switch between weapons while still holding the shield, any idea on how to do this?
Either A) edit all the weapons/make new versions. B) make it work more like beat support.
Title: Re: The "How do I make a weapon do that?" thread
Post by: HellHawkX on January 26, 2013, 11:16:06 AM
Quote from: "fortegigasgospel"
Either A) edit all the weapons/make new versions. B) make it work more like beat support.
A will be kind of hard to do and will take a lot of time, but I like the Beat Support idea, that could work well

EDIT: Question 2: How do I give a character higher jump in Classes?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Zard1084 on January 26, 2013, 06:19:59 PM
Oh oh I know that answer! Change the Jumpz from 10 to something higher
Here take a look at one of my classes i made:
(click to show/hide)
now take a look at where it says player.jumpz? yea thats where you change the jump height btw i have this class jumping twice as high
Title: Re: The "How do I make a weapon do that?" thread
Post by: -Daiki-TheOni on January 26, 2013, 11:15:03 PM
If you are lazy, you can put this too...

player.startitem "highjumprune"

(But Zard is right, change the jumpz value, is better idea...)
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on February 11, 2013, 10:04:18 AM
Is there a way to change a player's speed for a specific direction?

What I mean is, SetActorProperty (http://zdoom.org/wiki/SetActorProperty) changes a player's all-around speed. I'm looking for something that will let me change forward / backpedal speed independently from strafing (side-to-side) speed. Does anyone know of a way to do this? I don't care how ugly it looks as long as it reliably works. Thanks!
Title: Re: The "How do I make a weapon do that?" thread
Post by: fortegigasgospel on February 11, 2013, 10:59:51 AM
Quote from: "SmashBroPlusB"
Is there a way to change a player's speed for a specific direction?

What I mean is, SetActorProperty (http://zdoom.org/wiki/SetActorProperty) changes a player's all-around speed. I'm looking for something that will let me change forward / backpedal speed independently from strafing (side-to-side) speed. Does anyone know of a way to do this? I don't care how ugly it looks as long as it reliably works. Thanks!
Check top and centaur they both have it.
Title: Re: The "How do I make a weapon do that?" thread
Post by: DarkAura on February 11, 2013, 03:55:30 PM
Code: [Select]
player.forwardmove 0.8, 0.8 //Defines foward and backward speed
player.sidemove 0.78, 0.78 //Defines strafing speed
Title: geez guys I know how to basic Decorate
Post by: Hallan Parva on February 11, 2013, 05:30:41 PM
Quote from: "DarkAura"
Code: [Select]
player.forwardmove 0.8, 0.8 //Defines foward and backward speed
player.sidemove 0.78, 0.78 //Defines strafing speed


Quote from: "SmashBroPlusB"
Is there a way to chaaaaaaange a player's speed for a specific direction?
as in, I have a class with good all-around movement

let's say I suddenly want him to suck at strafing but move forward and back faster

how would I do THAT
Title: Re: The "How do I make a weapon do that?" thread
Post by: Magnet Dood on February 11, 2013, 05:58:55 PM
Look at Charge Man's class. He's able to move forward and backward rather fast, but his strafing is terrible.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on February 11, 2013, 07:56:49 PM
That's using A_ChangeVelocity(or is it still A_Recoil?), I have no idea how it would work in terms of changing running speed.
Title: Re: The "How do I make a weapon do that?" thread
Post by: MasterXman on February 17, 2013, 12:47:50 AM
Is it possible to make a weapon that launches you in the direction of your aim?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on February 17, 2013, 06:15:11 AM
Go look at Captain Falcon in Balrog's Saxton.
Title: Re: The "How do I make a weapon do that?" thread
Post by: SmashTheEchidna on February 17, 2013, 06:29:22 AM
Quote from: "xxkirbysonicxx1"
Is it possible to make a weapon that launches you in the direction of your aim?
Quote from: "Korby"
Go look at Captain Falcon in Balrog's Saxton.

(http://i72.servimg.com/u/f72/15/63/01/05/idea10.png) Oh!

I just had a eureka moment! Now I wanna try something.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hilman170499 on February 19, 2013, 03:47:20 PM
2 Questions:

1) How to make shots that absorb enemy damage?

2) How to make shots in which they will react to another shot from the same user?
(click to show/hide)

Thanks in advance to those willing to answer these.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on February 19, 2013, 03:59:16 PM
1) You can do this, but it is quite broken and not recommended
Code: [Select]
+SHOOTABLE
-NOBLOCKMAP
This makes the object shootable and removes the code that makes things not hit it.

2) 1 makes it absorb pretty much all possible shots...
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hilman170499 on February 20, 2013, 01:14:57 PM
So, I used that code but it made a new problem:

If the shot takes more than 1 hits to react, it will move to the side whenever it absorbs damage. Anyone knows how to fix that?

And another question:

How do you change the spawn height for projectiles?

Code: [Select]
A_FireCustomMissile("ProjectileName",angle,usesammo,<1>,<2>)
Is it <1> or <2>? I think it's 2 because it's called 'int spawnheight'.

Even then, how to make it spawn higher? Make it negative or positive?

Thanks in advance to the next poster who answers these questions.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Ukiyama on February 20, 2013, 04:44:10 PM
Quote from: "Hilman170499"
If the shot takes more than 1 hits to react, it will move to the side whenever it absorbs damage. Anyone knows how to fix that?

You need to crank up its mass. Megaman's is 9999, and he still can move around a tad when being hit, so just throw a couple more nines on there for good measure and it should be fine.
Title: Re: The "How do I make a weapon do that?" thread
Post by: SmashTheEchidna on February 21, 2013, 11:31:05 PM
So, out of curiosity, I want to give my weapon the ability to grapple on the hooks like Thunder Claw. What exactly triggers the grapple&swing?
Title: Re: The "How do I make a weapon do that?" thread
Post by: leoalex50 on February 22, 2013, 12:26:06 AM
Quote from: "Gizmo The Cat"
So, out of curiosity, I want to give my weapon the ability to grapple on the hooks like Thunder Claw. What exactly triggers the grapple&swing?
look at thunder claw's code
Title: Re: The "How do I make a weapon do that?" thread
Post by: Balrog on February 22, 2013, 01:07:33 AM
(http://i2.kym-cdn.com/photos/images/original/000/049/216/cptobvious.jpg)
It looks like you just need to make your grappler actor deal damage with the ThunderClaw damagetype. Or you could replace ThunderClawPeg with a custom actor that responds to your grappler.
Title: Re: The "How do I make a weapon do that?" thread
Post by: SmashTheEchidna on February 22, 2013, 01:24:32 AM
I was hoping to not actually use the damagetype itself in case there was another way. But I could try it regardless.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Colonel ServBot on February 28, 2013, 03:50:41 PM
Hey guys. I was wondering. Lets say if there were a weapon, and it was long range and melee( I already know how to do this), but what if the person wielding a weapon was able to attack players that are close to him/her/it automatically with out pressing the fire button and firing a different projectile.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Zard1084 on March 13, 2013, 09:24:11 AM
Ok here is my question.. i'm trying to make a shield weapon work like this... when the barrier takes damage have it heal the person using the barrier.. can anyone help me? (btw this for a class in my mod)
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on March 13, 2013, 05:22:33 PM
I don't know how well it will work, but you could have the shield spawn shootable things that, when shot, heal their target. I think that's similar to how Woodman works in Classes.

The problem lies in the fact that I don't remember if things change their target when they're shot.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Zard1084 on March 13, 2013, 05:36:44 PM
Hmm... well thanks for trying to help! i found a different way to make it work using some of plantman's coding
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hilman170499 on March 15, 2013, 03:56:30 PM
I got 2 questions...

1) How do you make a shield that ONLY BLOCKS SPECIFIC DAMAGE TYPES?

2) How do you make it so that if you use A_Jump, one action occurs more often than the other?

For example, there are lines A and B. A_Jump will have an 80% chance of going to A and a 20% chance if going to B.

Thanks in advance.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on March 15, 2013, 04:36:52 PM
To make a shield block specific damagetypes, you would want to give the player an item inheriting from PowerProtection and that has a damagefactor of 0 for those damagetypes.
for example:
Code: [Select]
actor HilShieldProtect : PowerProtection
{
damagefactor "Fire", 0//Immunity to lava
}

As for the A_Jump, that can be handled in several ways...the easiest would be to list the states mutliple times when calling A_Jump...
I'll just give you an example even though this is fairly self-explanitory
Code: [Select]
TNT1 A 0 A_Jump(256,//Will always jump
"End",
"End",
"End",
"Continue")//3/4 chance of failing.
The more difficult but prettier code-wise would be to use Party Ball's method which just uses a lower number in the first argument of A_Jump, which handles the chance of the actor jumping to a different state.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Caprice on March 19, 2013, 12:56:18 AM
Is it possible to make a homing missile that only targets a certain actor/projectile? I couldn't really find anything that could help me in the ZDoom wiki. Thanks in advance.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on March 19, 2013, 05:02:36 AM
Well, when a homing missile...homes in, it targets a single person and technically stays targeted on that person. The only things is, when A_MStaffTrack is called, it tries to acquire a new target. There is a way to make a homing missile that targets a single thing and doesn't change at all, but that requires ACS and some forced-coded shennaners...it would be complex and annoying and I don't recommend doing that.

However, I think it's possible to just make a missile stop homing once the target is in view of the missile by using A_JumpIfTargetInLOS, similar to what Homing Sniper does.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Caprice on March 24, 2013, 04:09:02 PM
I have another question. How do I make it so A_Refire jumps to a different, predefined state? I checked ZDoom and did everything on there well, but when I run Zandronum it says I can't "pass parameters to (". That's okay and all, but I just want to know what I can pass parameters to. Thanks in advance.
Code: [Select]
P1WP F 0 A_Refire ("ShootMissile")
Title: Re: The "How do I make a weapon do that?" thread
Post by: Ivory on March 24, 2013, 04:16:08 PM
One thing to keep in mind, ZDoom is leagues ahead of Zandronum in features. Simply, what you're trying to do does not exist in Zandronum yet.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Caprice on March 24, 2013, 04:21:58 PM
Ah, that explains things. I'll figure out another way to bypass this.
Title: Re: The "How do I make a weapon do that?" thread
Post by: tsukiyomaru0 on March 24, 2013, 06:55:03 PM
Quote from: "Player 1"
Ah, that explains things. I'll figure out another way to bypass this.
use A_GiveInventory to give an item that acts as a flag and an A_JumpIfInventory at the start of the Fire state to check if said item is in inventory, to then cause a jump to that other state. Be sure to have A_TakeInventory at the end of either Fire or the new state (or even both)  and Deselect to remove the flag.
Title: Re: The "How do I make a weapon do that?" thread
Post by: HellHawkX on April 10, 2013, 09:57:02 AM
All right, here is (probably) a tough one
I am trying to make a teleport weapon, but I don't want it to teleport like exitunit, I want it to teleport in a specified location
Imagine dropping a "teleport bullet" near a E-Tank and you go out to fight, when you feel like you're in danger, you press alt-fire and get teleported to where you dropped the bullet.
I looked into ArtiTeleport, but I didn't figure out much
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on April 10, 2013, 01:05:30 PM
That...is a bit more complex than it sounds...but I suppose it would be more tedious than hard the most difficult part would be making sure the player doesn't get stuck in walls when it's being used, which, in the way I'm thinking...will probably not be that easy whatsoever.

I will need a moment to experiment, but I think it should be simple...and by that, I totally mean the most complex piece of crap ever, and in the vein of Jax's Damage over Time code. (see Classes-v6f Wily Fire)

---

Ok, so here is what I came up with.
(click to show/hide)
It's not perfect, but it does successfully teleport the player to the location of the shot upon the shot's death.
Please note: This can be used to get the areas not normally gotten to...I suppose I will try and fix that later, and use on walls and ceilings fails entirely. It also only works with the first player that spawns, which means states 2-64 must be made in order to get it to work right.

Also, you have to be given the item "TIDSetter" in order to successfully use this shot.

edit: augh, Spoiler tags
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on April 10, 2013, 06:02:59 PM
How do you make an item trigger from a weapon's FIRE state, like Beat Support?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on April 10, 2013, 06:08:07 PM
ACS...most accurately, script 300 in MM8BDM-v3a
(click to show/hide)
The lines you are interested in are GetPlayerInput and GiveInventory lines.
Title: Re: The "How do I make a weapon do that?" thread
Post by: tsukiyomaru0 on April 10, 2013, 07:56:00 PM
Quote from: "SmashBroPlusB"
How do you make an item trigger from a weapon's FIRE state, like Beat Support?
Have an A_JumpIfInventory check if the item is in inventory to jump to an "UseItem" or something, where it will do the actions and then jump back to fire, but with a jump straight to the point after A_JumpIfInventory
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on April 10, 2013, 09:54:43 PM
That doesn't necessarily work 100% of the time...he asked from "A weapon" not a a custom weapon...your suggestion would work for a custom weapon, while mine would be a more omniscient suggestion and can work with all weapons regardless of whether they are custom.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on April 11, 2013, 05:56:15 AM
Exactly what Lego said. I was trying to make a custom inventory item that could (theoretically) work with anything ever, and its effects are triggered based on whether a player attacks or not.

Anyway, thanks for the help!
Title: Re: The "How do I make a weapon do that?" thread
Post by: JaxOf7 on April 11, 2013, 07:26:01 AM
Lego, that is an interesting decorate solution to getting the teleport bullet to know who fired it.
But here is the acs solution:

ACS
Code: [Select]
script 147 (void)
{
SetActivatorToTarget(0);
SetResultValue(ActivatorTID());
}

Decorate
Code: [Select]
actor TeleportShot : MegaShot replaces MegaShot
{
States
{
Death:
TNT1 A 0 Thing_ChangeTID(0, 1101)
TNT1 A 0 Thing_Move(ACS_ExecuteWithResult(147), 1101, 0)
stop
}
}
Title: Re: The "How do I make a weapon do that?" thread
Post by: Stardust on April 15, 2013, 02:39:21 PM
So, I would like to create an invisible hitbox and be able to control the area where it spawns with X/Y/Z offsets.
To put it simply, take a look at the Mega Ball. When you fire, Mega Ball is materialized some small steps forward, and not directly from "your body". The gameplay idea would be like the GunDelSol card from the MMBNetwork series : you know, the flashing light spawns and damage not in front, but on the second column.
Also, unlike Mega Ball which use A_SpawnItemEx, disabling aiming and spawning at a fixed point, I'd be able to aim my hitbox like with A_FireCustomMissile. Is it possible ?
Also, my hitbox won't deal explosive damages, but simply hurt one time if an opponent touches the hitbox.

...eeer, puh-lease tell me if I was confusing somewhere.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Zard1084 on April 15, 2013, 03:08:10 PM
Quote from: "Stardust"
So, I would like to create an invisible hitbox and be able to control the area where it spawns with X/Y/Z offsets.
To put it simply, take a look at the Mega Ball. When you fire, Mega Ball is materialized some small steps forward, and not directly from "your body". The gameplay idea would be like the GunDelSol card from the MMBNetwork series : you know, the flashing light spawns and damage not in front, but on the second column.
Also, unlike Mega Ball which use A_SpawnItemEx, disabling aiming and spawning at a fixed point, I'd be able to aim my hitbox like with A_FireCustomMissile. Is it possible ?
Also, my hitbox won't deal explosive damages, but simply hurt one time if an opponent touches the hitbox.

...eeer, puh-lease tell me if I was confusing somewhere.
That shouldn't be too hard to do Just use A_FireCustomMissile and just make the projectile be invisible and spawn and disappear quickly and then have the projectile spawn what you want. i might be wrong but i hope i helped you...
Title: Re: The "How do I make a weapon do that?" thread
Post by: Stardust on April 15, 2013, 03:18:20 PM
Quote from: "Zard1084"
That shouldn't be too hard to do Just use A_FireCustomMissile and just make the projectile be invisible and spawn and disappear quickly and then have the projectile spawn what you want. i might be wrong but i hope i helped you...

Oh I see, that's clever, I missed that hint. So, in order, it should...
1) Use FireCustomMissile for aiming working purpose only
2) FireCustomMissile spawns some kind of invisible reference
3) That reference quickly disappear, but before, it'll use SpawnItemEx, which has all the X/Y/Z parameters needed to spawn the hitbox.

And also, if this hitbox spawns INSIDE some robot's body, will it OHKO this later one ? I'm pretty sure that I saw somewhere, that the Mega Ball could OHKO a player if the ball spawns inside...
Title: Re: The "How do I make a weapon do that?" thread
Post by: Zard1084 on April 15, 2013, 03:26:52 PM
Quote from: "Stardust"
Quote from: "Zard1084"
That shouldn't be too hard to do Just use A_FireCustomMissile and just make the projectile be invisible and spawn and disappear quickly and then have the projectile spawn what you want. i might be wrong but i hope i helped you...

Oh I see, that's clever, I missed that hint. So, in order, it should...
1) Use FireCustomMissile for aiming working purpose only
2) FireCustomMissile spawns some kind of invisible reference
3) That reference quickly disappear, but before, it'll use SpawnItemEx, which has all the X/Y/Z parameters needed to spawn the hitbox.

And also, if this hitbox spawns INSIDE some robot's body, will it OHKO this later one ? I'm pretty sure that I saw somewhere, that the Mega Ball could OHKO a player if the ball spawns inside...
Well the thing is the megaball ohkos because the megaball bounces and thus the victim takes alot of damage in a short time and
1. yes
2.yes
and 3. YES!
I'm glad you understood quickly.
Edit: i'm fairly new to making weapons myself so i may have forgot something.... but you can check out what i made here (http://www.cutstuff.net/forum/viewtopic.php?f=28&t=5042)
Title: Re: The "How do I make a weapon do that?" thread
Post by: Stardust on April 15, 2013, 04:09:37 PM
Quote from: "Zard1084"
Well the thing is the megaball ohkos because the megaball bounces and thus the victim takes alot of damage in a short time and
1. yes
2.yes
and 3. YES!
I'm glad you understood quickly.
Edit: i'm fairly new to making weapons myself so i may have forgot something.... but you can check out what i made here (http://www.cutstuff.net/forum/viewtopic.php?f=28&t=5042)

Ah, yeah, bouncing in a solid works like some kind of infinite very fast bouncing... indeed, indeed. Anyway making the Mega Ball penetrate a solid actor (= player) shouldn't be usual and easy to do, in that case.
I'll take a look at your weapons once I'll finish mine if you want me to =w=

EDIT : Weirdly enough, it doesn't work. The reference spawn the actual projectile, but not at the desired aim...
Title: Re: The "How do I make a weapon do that?" thread
Post by: Zard1084 on April 15, 2013, 07:40:43 PM
Quote from: "Stardust"
Quote from: "Zard1084"
Well the thing is the megaball ohkos because the megaball bounces and thus the victim takes alot of damage in a short time and
1. yes
2.yes
and 3. YES!
I'm glad you understood quickly.
Edit: i'm fairly new to making weapons myself so i may have forgot something.... but you can check out what i made here (http://www.cutstuff.net/forum/viewtopic.php?f=28&t=5042)

Ah, yeah, bouncing in a solid works like some kind of infinite very fast bouncing... indeed, indeed. Anyway making the Mega Ball penetrate a solid actor (= player) shouldn't be usual and easy to do, in that case.
I'll take a look at your weapons once I'll finish mine if you want me to =w=

EDIT : Weirdly enough, it doesn't work. The reference spawn the actual projectile, but not at the desired aim...
I Knew i forgot Something! hold on let me check some stuff...
Edit: try using the wiki here (http://zdoom.org/wiki/A_SpawnItemEx) i hope this helps...
Title: Re: The "How do I make a weapon do that?" thread
Post by: Colonel ServBot on May 01, 2013, 05:01:12 PM
Okay...
I actually have quite a few things I need to ask you guys.

How would I code a weapon that grapples on to things like walls and other players, and brings the user towards them? but has about the range of duo fist? Basically, how do I make a weapon that acts like duo fist, but the user can grapple on to things with it.

Also, what about a melee weapon that grabs the person and turns them around to the user, then is insta killed afterward?

Also, how about this classes thing, like if one class picks up another classes weapon, but gets another weapon of their own instead?

And how do I add sounds to weapons? I've tried nearly every thing and it just doesn't work.
Title: Re: The "How do I make a weapon do that?" thread
Post by: CStar7 on May 12, 2013, 04:26:12 PM
Hi, guys.

I made a weapon that fires shots on FIRE, and reloads the ammo bar on FIRE-HOLD. I made a bot to use this weapon, but when he attacks, he only shoots 1 shot. Of course, bots always try to charge their weapon, or continually fire it. My question is "How do I stop the bot from holding fire?".
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on May 12, 2013, 05:43:08 PM
Check Atomic Fire. It has scripts that make bots fire in certain states.
Title: Re: The "How do I make a weapon do that?" thread
Post by: tsukiyomaru0 on May 12, 2013, 06:24:39 PM
Quote from: "Korby"
Check Atomic Fire. It has scripts that make bots fire in certain states.
Otherwise, it can be handled with jumps checking for MonsterBlock, right?
Title: Re: The "How do I make a weapon do that?" thread
Post by: CStar7 on May 12, 2013, 07:29:09 PM
Quote from: "Korby"
Check Atomic Fire. It has scripts that make bots fire in certain states.

Do you know where the scripts for that are?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on May 12, 2013, 07:39:12 PM
There should be a state called botcheck that forces the bot to fire their weapon. The script must be called once in order to work.
Title: Re: The "How do I make a weapon do that?" thread
Post by: CStar7 on May 12, 2013, 08:21:18 PM
I'm still pretty confused. I've tried adding that botcheck thing to my script, and it still won't let the bot continually fire the weapon.

EDIT: Nevermind. I figured it out.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hilman170499 on June 06, 2013, 04:44:50 AM
Bump:

How to make an actor(not CustomInventory) that activates immidiately and does an action?

Thanks in advance.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on June 06, 2013, 04:51:33 AM
You mean like...it does stuff in the spawn state?
you just...add commands to the spawn state...

Like...I suppose I can do this.

Code: [Select]
actor SpinningMegaman : FreezeTree1
{
States
{
Spawn:
PLAY A 1 A_SetAngle(angle+10)
loop
}
}
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hilman170499 on June 06, 2013, 05:16:22 AM
I mean an inventory item that activates and does actions immidiately after being in another actor's inventory.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on June 06, 2013, 01:07:51 PM
You mean like an item that activates instantly upon entering the inventory of an actor? Because all you have to do is attatch +INVENTORY.AUTOACTIVATE to any custominventory.

I don't quite understand what you mean...
Could you enunciate your meaning and provide an example?
Title: Re: The "How do I make a weapon do that?" thread
Post by: ServantofCygnus on June 07, 2013, 03:36:32 AM
disregard this
Title: Re: The "How do I make a weapon do that?" thread
Post by: ServantofCygnus on June 07, 2013, 03:36:53 AM
UGH SO MANY THINGS I WANT TO ASK
How to make a weapon spread out (like bass buster)

how to speed up the firing rate

how to make something hitscan

how to make something fire constantly with no breaks in between

how to add an instagib weapon to a class

how to actually add a class
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on June 07, 2013, 04:55:20 AM
Uh...have you tried checking this?
http://zdoom.org/wiki/Decorate

In seriousness, though.
1) http://zdoom.org/wiki/A_FireCustomMissile: Second argument is the angle at which something fires in relation to the player's angle.
2) Reduce the delay at the end of a fire state; This requires knowledge of DECORATE and is hard to explain in shorthand. If you want to know in high detail with examples, just shoot me a PM. (Please don't quote this post in it, that's my only request if you do)
3) http://zdoom.org/wiki/A_FireBullets: Hitscan attack. You also need knowledge of DECORATE to use this effectively, but I feel I should mention that damagetypes for this are established by the given bulletpuff. There are example weapons based in Doom on the wiki if you must know how to use this immediately, but I recommend learning in 8BDM considering it is, you know, free.
4) Explanation please?
5) That requires modification of global ACS stuff and is incredibly tedious...see CSCCACS.ACS in any version of CSCC as the first script given has the instag/botcheck script.
6) You need to first establish a new actor based on the Megaman actor; to add it as a class to the menu, you will use a KEYCONF lump:
Code: [Select]
addplayerclass classname

I also got no response from Hil in regards to this:
Quote from: "Lego"
I don't quite understand what you mean...
Could you enunciate your meaning and provide an example?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Zard1084 on June 08, 2013, 01:17:38 AM
Ok Quick question i'm trying to make a item that lets you set down a portable teleport anywhere (even in mid air) that when you have two of them set down you can enter and exit both ways but can only be used by the user ( i know cutmanmike did a portal gun but i don't know how it works)
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on June 08, 2013, 01:45:38 AM
While that is a rather simple thing to make in pure decorate, it will have lots and lots actors involved in order to set things up based on which TID you have.
But simply...you will need a total of 256 actors, based on individual player thing ids.

64 actors for the initial teleporters
64 for the returning teleporters
64 for teleporting inventory
64 for the teleporting BACK inventory

Now...I know it seems complex, but it really just comes down to four actors: A Primary teleport, a secondaray teleport, and two items that move the player between them.

In order to teleport JUST that player, however, there needs to be 64 of them to keep track of individual player ids, as mentioned previously.

I will put together a prototype and try to get it all working within the hour. I will edit this post when I have the code for the first set of components. Please be aware, though that I am a very lazy coder and will only complete the first two sets for player numbers 0 and 1 (using thing ids 1000 and 1001 respectively.)
Title: Re: The "How do I make a weapon do that?" thread
Post by: tsukiyomaru0 on June 08, 2013, 01:47:49 AM
Quote from: "Zard1084"
Ok Quick question i'm trying to make a item that lets you set down a portable teleport anywhere (even in mid air) that when you have two of them set down you can enter and exit both ways but can only be used by the user ( i know cutmanmike did a portal gun but i don't know how it works)
I have a portal gun for MM8BDM somewhere.. You could look into that, it uses no ACS but is VERY primitive.
There's also this: The target of a projectile (Target, not Tracer) is always the one who shot it. And then there's THING_MOVE, an Action Special.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on June 08, 2013, 03:04:29 AM
Gah...that got really painful really fast...

I never actually got it working both ways, but it was based on the idea Tsuki came up with for his portal gun, but it was going to be adapted so that it could be used with a full 64-player server. Basically, it was going to use TID's 70000-70064 and 71000-71064 to move the player around...too bad I am an inefficient coder and tend to over think things...I suppose it could also be done using ACS, being a bit less complex, but most people new to ZDoom/Zandronum modding generally try to stick to Decorate.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Zard1084 on June 08, 2013, 03:09:34 AM
Quote from: "Lego"
Gah...that got really painful really fast...

I never actually got it working both ways, but it was based on the idea Tsuki came up with for his portal gun, but it was going to be adapted so that it could be used with a full 64-player server. Basically, it was going to use TID's 70000-70064 and 71000-71064 to move the player around...too bad I am an inefficient coder and tend to over think things...I suppose it could also be done using ACS, being a bit less complex, but most people new to ZDoom/Zandronum modding generally try to stick to Decorate.
I can give ACS a try if its less work but thank you for trying
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on June 08, 2013, 03:12:33 AM
Ok, It would be the same primary functions such as Thing_ChangeTID and Thing_Move.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Zard1084 on June 08, 2013, 03:18:37 AM
Quote from: "Lego"
Ok, It would be the same primary functions such as Thing_ChangeTID and Thing_Move.
alright i'll give it a try
Edit: i found tuski's portalgun mod and i may try to adapt it into a item for my class in teapartyclasses btw its gonna be hard coded into my weapons so basicly using the item one time just spawns the first portal and using it again spawns the second one
Title: Re: The "How do I make a weapon do that?" thread
Post by: Jakeinator on June 09, 2013, 02:47:11 AM
Small question I'm trying out a custom weapon, and i got an error; what does it mean if i get the error Bad Syntax for the sbarinfo lump?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on June 09, 2013, 03:07:42 AM
Bad Syntax means you didn't put the code together correctly.

Generally when you put together code in SBARINFO, it is just modified copypasta...at least for Megaman-esque huds.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Jakeinator on June 09, 2013, 04:35:49 PM
strange I copy-pasted the code exactly the way it was... meh I'll take another look at it I suppose.

EDIT: so i copy-pasted again, seems as if i left out a part by accident. Then it gave me a "weapon does not exist error" then i found out i forgot to put #include. Thanks for the help!
Title: Re: The "How do I make a weapon do that?" thread
Post by: Stardust on June 16, 2013, 11:43:28 AM
I've a problem too with my weapons when it casts A_SpawnItemEx (http://zdoom.org/wiki/A_SpawnItemEx).
Zandronum won't launch the game if the SXF_TRANSFERPOINTERS flag is set. I was wondering if this flag was still usable...? It's a really crucial one for frag count and some mechanics...
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on June 16, 2013, 10:39:13 PM
It is currently unimplemented in Zandronum.
As are many (http://zdoom.org/wiki/A_RearrangePointers) other pointer (http://zdoom.org/wiki/A_FaceMaster) related functions. (http://zdoom.org/wiki/SetPointer)

just to name a few.
Title: Re: The "How do I make a weapon do that?" thread
Post by: tsukiyomaru0 on June 16, 2013, 10:47:08 PM
Quote from: "Stardust"
I've a problem too with my weapons when it casts A_SpawnItemEx (http://zdoom.org/wiki/A_SpawnItemEx).
Zandronum won't launch the game if the SXF_TRANSFERPOINTERS flag is set. I was wondering if this flag was still usable...? It's a really crucial one for frag count and some mechanics...
Projectiles tends to treat the one who spawned them as their target, so I guess this is it? Also, I think a more useful flag would be SXF_TRANSFERPITCH... But that's just me, right?
Title: Re: The "How do I make a weapon do that?" thread
Post by: xColdxFusionx on June 16, 2013, 10:52:22 PM
The actual answer: No, Zandronum does not have SXF_TRANSFERPOINTERS.

And a question: IIRC, I believe someone created a working "poison/burn" effect in Zandronum that applies the proper obituary. How exactly does that work?
Title: Re: The "How do I make a weapon do that?" thread
Post by: tsukiyomaru0 on June 16, 2013, 11:02:21 PM
Quote from: "xColdxFusionx"
The actual answer: No, Zandronum does not have SXF_TRANSFERPOINTERS.

And a question: IIRC, I believe someone created a working "poison/burn" effect in Zandronum that applies the proper obituary. How exactly does that work?
YD Classes, Wily Capsule, Wily Burner. That's all I can say on the subject.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on June 16, 2013, 11:07:34 PM
Well, it uses 32 unique actors of three different types to accurately deal with Damage over time. See Classes v6f gravityman's class definition and wily's class definitions. Basically, it spawns an item that checks the thing id of the one that's being attacked and uses an actor spawned by the player that fired to continuously hit something.

Also poison damage will be a thing in Zandronum 1.1 (http://zandronum.com/tracker/view.php?id=1261), which would probably be way easier to pull off anyway.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on June 17, 2013, 03:58:58 AM
Can I make a projectile / explosion "forget" who shot it, so it hurts all players indiscriminately? How would I do that?


Yes, I realize this would also remove the potential to earn frags with said attack, thanks for asking.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on June 17, 2013, 04:16:58 AM
That's simple, A_ClearTarget removes the Projectile's owner from its memory.

Additionally, explosions have the option of hitting their owner simply by omitting the third argument, as you see on my class and on Uki's Shield gun.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on June 17, 2013, 04:46:47 AM
I already sort of knew the explosion thing, the problem being that it ONLY adds "I can hit my master". In short, if you play Team Deathmatch or something, a bomb can hit enemy players and the player who threw it, but not the throwing player's allies.


Didn't know it was that easy though, thanks.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Stardust on June 17, 2013, 11:15:03 AM
Use a CustomInventory sewer.
At the moment where the explode should occur, spawn an actor that will itself receive a CustomInventory that autoactivates and deals a A_Explode when used. That way the use of CustomInventory turns the explosion into a generic "damager" that isn't created by any player's hand.

By the way Lego do you know all the codes of every famous mods ? o////o
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on June 17, 2013, 05:33:45 PM
I do not. I just try to keep up to date with how certain objects work so that I can give good advice here or use it for me own evil ends. It's not like you can ask me how Classes wall jumping works and I would be able to tell you off the top of my head, but I can tell you it does involve an ACS script that checks if you ware pressing the jump button more than once.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Balrog on June 17, 2013, 05:37:45 PM
Quote from: "SmashBroPlusB"
I already sort of knew the explosion thing, the problem being that it ONLY adds "I can hit my master". In short, if you play Team Deathmatch or something, a bomb can hit enemy players and the player who threw it, but not the throwing player's allies.


Didn't know it was that easy though, thanks.
Except then everyone killed with the damagers gets "%o died." instead of a proper obituary. There's no real support for killing your teammates without the server turning friendly fire on. This is intentional.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hilman170499 on June 18, 2013, 12:42:36 PM
About my last question, I got a bit of help from it. Thanks.

But scratch the rest off, I have another one;
How do you make temporary Runes(stuff like Rage, Haste and Spread)? Powerup duration doesn't work because Runes apparently do not inherit coding from Powerup.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on June 18, 2013, 01:17:32 PM
Runes are permanent until you collect another one. Though a simple thing you can do is base a giver system off of the Junk Shield watcher and give the item "rune" to yourself to force the current one to deactivate.
Title: Re: The "How do I make a weapon do that?" thread
Post by: -Daiki-TheOni on June 18, 2013, 04:15:15 PM
I think Spheres can do what he means.... "give turbosphere" gives you more speed for a limited time, for example.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Stardust on June 21, 2013, 11:39:44 PM
Quote from: "Lego"
It is currently unimplemented in Zandronum.
As are many (http://zdoom.org/wiki/A_RearrangePointers) other pointer (http://zdoom.org/wiki/A_FaceMaster) related functions. (http://zdoom.org/wiki/SetPointer)

just to name a few.

I saw it sooner, but... sigh. Can a script do "Set the target of the one who executed the script to its target's target ?"
With poorly visual help it means

--------- ACTOR SP (I spawn ACTOR 1)  --------
--------- ACTOR 1 (my target is ACTOR SP because it spawned me, and I spawn ACTOR 2)  ---------
--------- ACTOR 2 (my target is ACTOR 1 because it spawned me, but I use the miraculous script to set my target to ACTORSP) ---------

I'm really a broken arm at ACS, I can only barely edit some stuff that already exists, but not really create mines.
Title: Re: The "How do I make a weapon do that?" thread
Post by: tsukiyomaru0 on June 22, 2013, 12:15:53 AM
Quote from: "Stardust"
Quote from: "Lego"
It is currently unimplemented in Zandronum.
As are many (http://zdoom.org/wiki/A_RearrangePointers) other pointer (http://zdoom.org/wiki/A_FaceMaster) related functions. (http://zdoom.org/wiki/SetPointer)

just to name a few.

I saw it sooner, but... sigh. Can a script do "Set the target of the one who executed the script to its target's target ?"
With poorly visual help it means

--------- ACTOR SP (I spawn ACTOR 1)  --------
--------- ACTOR 1 (my target is ACTOR SP because it spawned me, and I spawn ACTOR 2)  ---------
--------- ACTOR 2 (my target is ACTOR 1 because it spawned me, but I use the miraculous script to set my target to ACTORSP) ---------

I'm really a broken arm at ACS, I can only barely edit some stuff that already exists, but not really create mines.

The target of a projectile is its master, and the target of a projectile spawned by a projectile is still its master
Title: Re: The "How do I make a weapon do that?" thread
Post by: Stardust on June 22, 2013, 12:35:36 AM
Yes you're right, actually here's a more delicate and refined situation
If I use a CustomInventory that spawns a missile, the missile won't hurt me.
But, if instead of directly spawning the missile, the C.Inventory spawns a SPAWNER that'll spawn the missile, then this missile will hurt me. I tried it
One of the attacks of my class actually comes... from my custom inventory. From using an item, in other words. >:I
Maybe is the CustomInventory's pointer system different ?

EDIT : WAIT, I found the problem (editing right now...)
Title: Re: The "How do I make a weapon do that?" thread
Post by: tsukiyomaru0 on June 22, 2013, 12:40:33 AM
Quote from: "Stardust"
Yes you're right, actually here's a more delicate and refined situation
If I use a CustomInventory that spawns a missile, the missile won't hurt me.
But, if instead of directly spawning the missile, the C.Inventory spawns a SPAWNER that'll spawn the missile, then this missile will hurt me. I tried it
One of the attacks of my class actually comes... from my custom inventory. From using an item, in other words. >:I
Maybe is the CustomInventory's pointer system different ?
It's because the Spawner is not a projectile. You know, you can give a projectile the +NOINTERACTION to prevent them from being removed by collision before they can do their job.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Stardust on June 22, 2013, 12:42:35 AM
Uguu you posted riiiight after I found the solution, but anyway we thought the same ^^
Yes, I completly forgot how PROJECTILE can be useful with pointer inherit. With checkers, I usually set
+MISSILE
+NOCLIP
+NOINTERACTION
+DONTBLAST (so they don't go away into the infinite space :3)
To make sure NOTHING except a A_Jump thing could remove it.
Thanks, thanks a lot Tsuki
Title: Re: The "How do I make a weapon do that?" thread
Post by: tsukiyomaru0 on June 22, 2013, 12:47:49 AM
Quote from: "Stardust"
Uguu you posted riiiight after I found the solution, but anyway we thought the same ^^
Yes, I completly forgot how PROJECTILE can be useful with pointer inherit. With checkers, I usually set
+MISSILE
+NOCLIP
+NOINTERACTION
+DONTBLAST (so they don't go away into the infinite space :3)
To make sure NOTHING except a A_Jump thing could remove it.
Thanks, thanks a lot Tsuki
Oh, you are welcome. In fact, even I made this mistake in the past and just now I found the file with this flaw. Hilarity ensued
Title: Re: The "How do I make a weapon do that?" thread
Post by: Zard1084 on July 01, 2013, 01:02:51 AM
Quick question this may have been asked before.... i'm trying to figure out how to have two shots combine into a single new shot much like the x buster upgrade for X3? can anyone help with that?
Title: Re: The "How do I make a weapon do that?" thread
Post by: tsukiyomaru0 on July 01, 2013, 01:23:53 AM
Quote from: "Zard1084"
Quick question this may have been asked before.... i'm trying to figure out how to have two shots combine into a single new shot much like the x buster upgrade for X3? can anyone help with that?
The only way I can think of for two projectiles to fuse like this would be through ACS checks, and even so could be too much trouble to be worth.

However, an alternate way (simpler, but won't produce exactly the desired effect) could be having the first projectile check if something is in the target's inventory during the second shot.
If confirmed the item, it then checks if the target is close enough and, if confirmed, spawns another shot and destroys itself.
If not close enough, it instead gives an item that causes the player to fire the second projectile.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Zard1084 on July 01, 2013, 01:29:31 AM
Quote from: "tsukiyomaru0"
Quote from: "Zard1084"
Quick question this may have been asked before.... i'm trying to figure out how to have two shots combine into a single new shot much like the x buster upgrade for X3? can anyone help with that?
The only way I can think of for two projectiles to fuse like this would be through ACS checks, and even so could be too much trouble to be worth.

However, an alternate way (simpler, but won't produce exactly the desired effect) could be having the first projectile check if something is in the target's inventory during the second shot.
If confirmed the item, it then checks if the target is close enough and, if confirmed, spawns another shot and destroys itself.
If not close enough, it instead gives an item that causes the player to fire the second projectile.
hmm... well i can show you what i'm trying to do....
(click to show/hide)
basically i'm trying to make rolls buster in that vid
Edit: wait i have a idea! i can make one projectile shootable and if it gets hit by a special damage type the shot dies and spawns the newer more powerful projectile!
Title: Re: The "How do I make a weapon do that?" thread
Post by: tsukiyomaru0 on July 01, 2013, 01:52:03 AM
Quote from: "Zard1084"
Edit: wait i have a idea! i can make one projectile shootable and if it gets hit by a special damage type the shot dies and spawns the newer more powerful projectile!
There's only one problem with this: It doesn't tell who shot the projectile.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Zard1084 on July 01, 2013, 02:46:45 AM
Quote from: "tsukiyomaru0"
Quote from: "Zard1084"
Edit: wait i have a idea! i can make one projectile shootable and if it gets hit by a special damage type the shot dies and spawns the newer more powerful projectile!
There's only one problem with this: It doesn't tell who shot the projectile.
i know that tuski i was just gonna do that so i can just get it working and then revamp it to work with acs or some other thing later
Title: Re: The "How do I make a weapon do that?" thread
Post by: tsukiyomaru0 on July 01, 2013, 04:11:14 AM
Quote from: "Zard1084"
Quote from: "tsukiyomaru0"
Quote from: "Zard1084"
Edit: wait i have a idea! i can make one projectile shootable and if it gets hit by a special damage type the shot dies and spawns the newer more powerful projectile!
There's only one problem with this: It doesn't tell who shot the projectile.
i know that tuski i was just gonna do that so i can just get it working and then revamp it to work with acs or some other thing later
Hm, maybe if you find a way to have it execute a script to contrast the TID of its master with that of the one who just shot the second projectile at it...
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on July 01, 2013, 07:19:37 AM
really really noob-tier question


I want to make a projectile turn into / spawn another projectile with the exact same angle as the first.
For some reason, my X projectile spawns the Y projectile, but it loses its vertical pitch, and I have no clue why.
(e.g. it just flies straight and doesn't go up or down even if X projectile was already going up or down)

I tried stealing lines of Decorate from every weapon pack I could think of, but to no avail. So now I'm asking here.
Title: Re: The "How do I make a weapon do that?" thread
Post by: tsukiyomaru0 on July 01, 2013, 07:26:41 AM
Quote from: "SmashBroPlusB"
really really noob-tier question


I want to make a projectile turn into / spawn another projectile with the exact same angle as the first.
For some reason, my X projectile spawns the Y projectile, but it loses its vertical pitch, and I have no clue why.
(e.g. it just flies straight and doesn't go up or down even if X projectile was already going up or down)

I tried stealing lines of Decorate from every weapon pack I could think of, but to no avail. So now I'm asking here.

There's this:
Code: [Select]
A_SpawnItemEx("subprojectilename",0,0,0,momx,momy,momz,0,SXF_ABSOLUTEMOMENTUM)
And, for a 45 angle but maintaining previous speed:
Code: [Select]
A_SpawnItemEx("subprojectilename",0,0,0,momx-(momy*0.7),momy+(momx*0.7),momz,0,SXF_ABSOLUTEMOMENTUM)
Title: Re: The "How do I make a weapon do that?" thread
Post by: Gummywormz on July 01, 2013, 03:52:38 PM
Quote from: "tsukiyomaru0"
There's this:
Code: [Select]
A_SpawnItemEx("subprojectilename",0,0,0,momx,momy,momz,0,SXF_ABSOLUTEMOMENTUM)

There's one problem with that. 0 is not defined as always being forwards. So firing the projectile at different parts of the map causes it to go sideways or backwards. I'd like a working example of this for my weapon pack's fade launcher.
Title: Re: The "How do I make a weapon do that?" thread
Post by: tsukiyomaru0 on July 01, 2013, 07:26:31 PM
Quote from: "Gummywormz"
Quote from: "tsukiyomaru0"
There's this:
Code: [Select]
A_SpawnItemEx("subprojectilename",0,0,0,momx,momy,momz,0,SXF_ABSOLUTEMOMENTUM)

There's one problem with that. 0 is not defined as always being forwards. So firing the projectile at different parts of the map causes it to go sideways or backwards. I'd like a working example of this for my weapon pack's fade launcher.

Because you forgot SXF_AbsoluteMomentum. Without the flag, X speed is forward/backward speed, Y is sideways and Z is vertical, where angle defines if the projectile will move into another direction. With the flag, the speeds are directly bound to the axis, so X will always be West to East, Y will be South to North and Z will be vertical. The angle, if you use SXF_AbsoluteMomentum, just serves to make the actor look at a specific direction while moving.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Davregis on July 02, 2013, 12:15:54 AM
How am I supposed to make a weapon work as a pickup for a different weapon e.g. CSCC Gizmo

>How do I make a weapon give me another weapon on pickup, but only allow certain weapons to be picked up?
Title: Re: The "How do I make a weapon do that?" thread
Post by: tsukiyomaru0 on July 02, 2013, 12:24:09 AM
Quote from: "Daveris"
How am I supposed to make a weapon work as a pickup for a different weapon e.g. CSCC Gizmo

>How do I make a weapon give me another weapon on pickup, but only allow certain weapons to be picked up?
I've thought about this several times... That ZDN mod, Samsara, has this. Kind of.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Shageta on July 07, 2013, 04:02:16 PM
Im just gonna ask .... How can i make an ALT FIRE weapon that zoom in when holding alt fire  :P
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on July 07, 2013, 04:56:02 PM
Quote from: "Zard1084"
Quick question this may have been asked before.... i'm trying to figure out how to have two shots combine into a single new shot much like the x buster upgrade for X3? can anyone help with that?

Going by what I saw in the video, couldn't you just have your giant charge shot have a pain state for the mid charge that makes them go to a second spawn/existing state that increases the speed[change velocity shenanigans]?To get increased damage, Uki mentioned something about a very small explosion radius on death for extra damage so that if you hit someone, you'll get extra damages.

Quote from: "Shageta"
Im just gonna ask .... How can i make an ALT FIRE weapon that zoom in when holding alt fire  :P
http://zdoom.org/wiki/A_ZoomFactor (http://zdoom.org/wiki/A_ZoomFactor)

Use it on the AltHold state and you'll only zoom in while holding altfire.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on July 07, 2013, 06:19:10 PM
You would have to place the A_ZoomFactor prior to A_Refire.
I believe calling it a second time with (1.0) as the argument will remove this effect.

Just to make a small amendment to what Korby here said~
Title: Re: The "How do I make a weapon do that?" thread
Post by: Colonel ServBot on July 19, 2013, 08:48:58 PM
Well, I tried making a Projectile home in on people and bots. But it keeps giving me random errors when I load the mod, Heres the projectile code.
Code: [Select]
actor ColonelBusterShot
{
speed 10
damage 2
 +RIPPER
 +SEEKERMISSILE
 +LOOKALLAROUND
 +DOOMBOUNCE
 +NOBLOOD
deathsound "sounds/clawhit"
seesound "weapon/mbuster"
PROJECTILE
states
{
Spawn:
BUST A 1 A_SeekerMissile
loop
Death:
    BUST A 0    
}
}

And no, the Buster Shot sprites are just a place holder, but how do I make this work?
Sorry for NecroBumping.
Title: Re: The "How do I make a weapon do that?" thread
Post by: tsukiyomaru0 on July 19, 2013, 08:56:05 PM
Quote from: "Colonel ServBot"
Well, I tried making a Projectile home in on people and bots. But it keeps giving me random errors when I load the mod, Heres the projectile code.
Code: [Select]
actor ColonelBusterShot
{
speed 10
damage 2
 +RIPPER
 +SEEKERMISSILE
 +LOOKALLAROUND
 +DOOMBOUNCE
 +NOBLOOD
deathsound "sounds/clawhit"
seesound "weapon/mbuster"
PROJECTILE
states
{
Spawn:
BUST A 1 A_SeekerMissile
loop
Death:
    BUST A 0    
}
}

And no, the Buster Shot sprites are just a place holder, but how do I make this work?
Sorry for NecroBumping.
Death does not stop
Title: Re: The "How do I make a weapon do that?" thread
Post by: Colonel ServBot on August 03, 2013, 09:22:06 PM
Oh, thats what I was missing! Thanks Tsuki! I'll add that now!
I feel stupid now, lol.

Okay, after nine million years of procrastination, i tested it.
Here's the new code for the projectile.
(click to show/hide)

And this is the error i get.
Code: [Select]
Execution could not continue.

Script error, "Colbuster.pk3:code/colonelbusternew.txt" line 76:
Expected '(', got 'loop'.

This is what I don't understand. even if the code is updated.

Also, How do you make a Melee weapon with Combos? Like Gizmo's Class' Claw gloves?
I already found out how to make a Melee weapon's projectiles(No, not by looking at Slash Claws code), but how do you make so it can attack by combo's?
Title: Re: The "How do I make a weapon do that?" thread
Post by: tsukiyomaru0 on August 03, 2013, 09:34:51 PM
I'm pretty sure that A_SeekerMissile requires at least one parameter.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Colonel ServBot on August 03, 2013, 09:57:06 PM
Quote from: "tsukiyomaru0"
I'm pretty sure that A_SeekerMissile requires at least one parameter.

How do I do that?
And whats a Parameter in this engine. Also, I'm sorry if this all sounds Noob-Tier. I'mjust an idiot who knows nothing about Decorate or ACS.
Title: Re: The "How do I make a weapon do that?" thread
Post by: <geminibro> on August 03, 2013, 10:43:11 PM
How do i make a chained projectile?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on August 04, 2013, 09:42:35 AM
are you referring to a weapon like duo fist?

if not, you'll have to be a bit more specific
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on August 04, 2013, 12:33:47 PM
Quote from: "Colonel ServBot"
How do I do that?
And whats a Parameter in this engine. Also, I'm sorry if this all sounds Noob-Tier. I'm just an idiot who knows nothing about Decorate or ACS.

+SEEKERMISSILE on the projectile's properties block and only the first two parameters work on this function in Zandronum. [A_SeekerMissile (http://zdoom.org/wiki/A_SeekerMissile)]
Also, just so you know, A_SeekerMissile is not the most reliable seeking code out there.
And idiots don't ask questions. You're trying to learn a whole new language here. It's natural to not know everything from the start, so no need to apologize.

Quote from: "<geminibro>"
How do i make a chained projectile?
As Korby said, you will need to specify. When I first read this question, the first thing to come to mind was the LoreShot from Strife, which just leaves a chain of visual actors behind it in the same way as Gemini Laser.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Megaman94 on August 07, 2013, 12:31:25 AM
What makes the player move backwards when they fire hard knuckle? I want to remove that for my weapon.
(click to show/hide)
EDIT: I get Script error, "OC Weapons.pk3:custom/weapons/superpunch.txt" line 70:
Missing token (unexpected end of file)." when I try to test my weapon on a map.
(click to show/hide)
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on August 07, 2013, 02:39:29 AM
Ok, first.
Spoiler your code...kthanks.

Second, the line that calls A_ChangeVelocity(-9, 0, 0, CVF_RELATIVE, CVF_REPLACE) is what controls the recoil.

Also "missing token" just means you forgot a closing brace at the end of your code somewhere.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Megaman94 on August 07, 2013, 03:43:47 AM
Now I am getting "Script error, "OC Weapons.pk3:custom/weapons/superpunch.txt" line 32:
"fire" is an unknown actor property"

And, according to Doombuilder it is called Hard Knuckle, not the name I gave it... :|
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on August 07, 2013, 08:15:01 AM
You have a right bracket under your select state and above your fire one.

Are your mod with doom builder? Also, your DoomED number is the same as Hard Knuckle's, so doom builder probably won't like the idea of having both of them.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Megaman94 on August 07, 2013, 05:10:42 PM
Where would I find "HARDSI"?  :?

EDIT: What controls the amount of damage  for hard knuckle?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on August 08, 2013, 04:03:57 PM
Code: [Select]
graphic HARDSI, 30, 30
{
   XScale 2.0
   YScale 2.0
   Patch WEAPT0, 0, 0
}

HARDSI as defined in the Textures lump.
It's basically WEAPT0, Hard Knuckle's weapon token icon, positioned under the ammo bar.

Code: [Select]
actor HardKnuckle
{
PROJECTILE
scale 2.5
damagetype "HardKnuckle"
Speed 38
Radius 12
Height 10
Damage (70)
States
{
Spawn:
HARD A 3
loop
Death:
MMFX BCDE 2
stop
}
}

Damage (70) is where the Hard Knuckle damage is defined on the projectile.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Megaman94 on August 08, 2013, 10:31:55 PM
Quote from: "Korby"
Code: [Select]
actor HardKnuckle
{
PROJECTILE
scale 2.5
damagetype "HardKnuckle"
Speed 38
Radius 12
Height 10
Damage (70)
States
{
Spawn:
HARD A 3
loop
Death:
MMFX BCDE 2
stop
}
}

Damage (70) is where the Hard Knuckle damage is defined on the projectile.


I am guessing it is out of 100?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on August 08, 2013, 11:44:32 PM
Players have 100 health by default, yes.
Title: Re: The "How do I make a weapon do that?" thread
Post by: fortegigasgospel on August 08, 2013, 11:54:14 PM
Also its just 70, as in no matter the HP, 70 of it will be taken by Hard Knuckle. When resistances are not taken into account.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hallan Parva on August 28, 2013, 09:20:34 PM
first of all why isn't this in Help & Editing
second of all why don't we have a "how do I do this, pls help" thread for classes



and third of all, the actual question

is there a simple way to make a custom class ignore the jump cancel script completely
or do I have to punch the jump cancel script in the face to allow for an exception or something
Title: Re: The "How do I make a weapon do that?" thread
Post by: tsukiyomaru0 on August 28, 2013, 09:28:06 PM
Quote from: "SmashBroPlusB"
first of all why isn't this in Help & Editing
second of all why don't we have a "how do I do this, pls help" thread for classes



and third of all, the actual question

is there a simple way to make a custom class ignore the jump cancel script completely
or do I have to punch the jump cancel script in the face to allow for an exception or something
Well, if ACS_Terminate works in Decorate just like ACS_Execute and the like does, you can just make the weapon for the class run this. No?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on August 28, 2013, 09:32:42 PM
Easiest way to my knowledge:
Modify the script directly by checking for an item given on spawn

EDIT: This gives me an idea for a suggestion for the core. Thank you.
EDIT 2: Lost all motivation to make it, so nevermind~
I'll just ask Mess to move the script over, since that's going to happen anyway.
Predicted Scenario:
Lego: Mess, please move the jump cancelling script over to the new WCOLORS file please.
Messatsu: What!? Why?
Lego: Because people mod it for double jumps and some weird jump mechanics.
Messatsu: Nooooo......

. . . . . . . Like the visual suggestions I made to the &Bass weapons to make the more flashy and 3D-like because everything ever is just flat sprites on a fixed animation.
Which I will most likely have to make into a mod that won't ever get played anyway because it will never make it to core with Mess sitting there.
Title: Re: The "How do I make a weapon do that?" thread
Post by: TheDoc on September 28, 2013, 03:52:10 PM
How would I make a projectile die after it stops moving across the x-axis? I'm making a projectile that slows to a stop in the same manner of Quick Boomerang, then dies (I had to time A_Countdown perfectly), but the problem is if I shoot it upwards, it goes backwards before stopping. So I tried saying
Code: [Select]
A_JumpIf(momx==0,"Death")but it just skipped past it completely and flew backwards into the wall. Shouldn't momx have worked?
Title: Re: The "How do I make a weapon do that?" thread
Post by: tsukiyomaru0 on September 28, 2013, 04:02:15 PM
Quote from: "TheDoc"
How would I make a projectile die after it stops moving across the x-axis? I'm making a projectile that slows to a stop in the same manner of Quick Boomerang, then dies (I had to time A_Countdown perfectly), but the problem is if I shoot it upwards, it goes backwards before stopping. So I tried saying
Code: [Select]
A_JumpIf(momx==0,"Death")but it just skipped past it completely and flew backwards into the wall. Shouldn't momx have worked?
Use A_ScaleVelocity to gradually cause it so slow, then use A_JumpIf(1>momx>-1 && 1>momy>-1 && 1>momz>-1, "death") after or before every frame that scales velocity. Not sure if the jumpif example here works, I'll test later

EDIT: Didn't work. But this one did:
Code: [Select]
ATBU A 1 A_ScaleVelocity(0.90)
ATBU A 0 A_JumpIf(5>momx && 5>momy && 5>momz,"Death")
ATBU A 0 A_JumpIf(momx>-5 && momy>-5 && momz>-5,"Death")

EDIT2: This one ALSO worked:
Code: [Select]
ATBU A 1 A_ScaleVelocity(0.90)
ATBU A 0 A_JumpIf(momx*momx<1 && momy*momy<1 && momz*momz<1,"Death")
Title: Re: The "How do I make a weapon do that?" thread
Post by: TheDoc on September 28, 2013, 09:47:50 PM
Quote from: "tsukiyomaru0"
EDIT2: This one ALSO worked:
Code: [Select]
ATBU A 1 A_ScaleVelocity(0.90)
ATBU A 0 A_JumpIf(momx*momx<1 && momy*momy<1 && momz*momz<1,"Death")

So I did this one (bcuz it looked like the same thing you put earlier except shorter) except I took out the momy and momz parts bcuz it should be allowed to be fired in the air (and it's not gonna go sideways, so...). For the most part, it works; it slows to a stop and then dies, so thank you for that :D . However, sometimes it just stops dead in its tracks and dies. I'm not completely sure why. :?
Title: Re: The "How do I make a weapon do that?" thread
Post by: tsukiyomaru0 on September 28, 2013, 10:06:40 PM
Quote from: "TheDoc"
Quote from: "tsukiyomaru0"
EDIT2: This one ALSO worked:
Code: [Select]
ATBU A 1 A_ScaleVelocity(0.90)
ATBU A 0 A_JumpIf(momx*momx<1 && momy*momy<1 && momz*momz<1,"Death")

So I did this one (bcuz it looked like the same thing you put earlier except shorter) except I took out the momy and momz parts bcuz it should be allowed to be fired in the air (and it's not gonna go sideways, so...). For the most part, it works; it slows to a stop and then dies, so thank you for that :D . However, sometimes it just stops dead in its tracks and dies. I'm not completely sure why. :?
Change that "<1" to a higher value if you want it to die before it comes to a dead stop. But, well, close enough :D
Title: Re: The "How do I make a weapon do that?" thread
Post by: TheDoc on September 28, 2013, 11:17:58 PM
Nononononono what I'm saying is that merely seconds after spawning, it will just stop and die.
Here's the code for reference:
Code: [Select]
Spawn:
FLB2 A 5 //This just helps me with the timing
FLB2 A 1 A_ScaleVelocity(0.8)
FLB2 A 0 A_JumpIf(momx*momx<1,"NearDeath")
Goto Spawn+1
NearDeath:
FLB2 A 1 A_ChangeVelocity(0,0,0,CVF_REPLACE)
FLB2 A 5
Death:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("OilPitIgnite",0,0,8)
stop
}
}
I want it to slow to a stop, float in mid-air for a brief moment, then die, and it works perfectly 85% of the time, but sometimes it will spawn, go at full speed like normal, but then after a half-second go straight to NearDeath.
Title: Re: The "How do I make a weapon do that?" thread
Post by: tsukiyomaru0 on September 29, 2013, 01:26:58 AM
Quote from: "TheDoc"
Nononononono what I'm saying is that merely seconds after spawning, it will just stop and die.
Here's the code for reference:
Code: [Select]
Spawn:
FLB2 A 5 //This just helps me with the timing
FLB2 A 1 A_ScaleVelocity(0.8)
FLB2 A 0 A_JumpIf(momx*momx<1,"NearDeath")
Goto Spawn+1
NearDeath:
FLB2 A 1 A_ChangeVelocity(0,0,0,CVF_REPLACE)
FLB2 A 5
Death:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("OilPitIgnite",0,0,8)
stop
}
}
I want it to slow to a stop, float in mid-air for a brief moment, then die, and it works perfectly 85% of the time, but sometimes it will spawn, go at full speed like normal, but then after a half-second go straight to NearDeath.
You forgot part of the code I showed you. The "momx*momx*momx<1 && momy*momy<1 && momz*momz<1", means it checks that X², Y² AND Z² speed are lower than 1. If you want it to ignore Z speed, just remove the "&& momz*momz<1" part
Title: Re: The "How do I make a weapon do that?" thread
Post by: TheDoc on September 29, 2013, 12:19:53 PM
But why would you need momy? Oh wait,
Quote from: "ZDoom Wiki"
momx — Actor's velocity along the absolute X axis
Ah, makes sense now.

Anyway, it works, so thank you again!
Title: Re: The "How do I make a weapon do that?" thread
Post by: BombHornet on November 01, 2013, 10:37:30 PM
I have a few questions. How do I make the Z-Saber for the HUD? And how do I make it slash three times?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on November 02, 2013, 02:47:50 AM
The answer to this is to learn DECORATE.
My apologies for the very ambiguous answer, but animation is one of the most basic yet complex things in DECORATE and it is very hard to explain properly.

I suggest you look at the weapon template. (http://cutstuff.net/forum/viewtopic.php?f=28&t=1815&start=80#p212799)

Also, you would need to play the animation three times and fire a projectile three times.
Hope this helped...not sure how it would if you don't want to put in the time to learn...
Title: Re: The "How do I make a weapon do that?" thread
Post by: Senkle on November 20, 2013, 10:27:39 PM
Is there a way to make it where an actor/player gets an item/attack/weapon depending on the type of terrain?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Gummywormz on November 20, 2013, 10:32:59 PM
If it's for when you are in water, just check for whatever the underwater flag is. If you want specific things like sand / grass, you can try an ACS script that's based on checkactorfloortexture (http://zdoom.org/wiki/CheckActorFloorTexture). Though if it's animated like lava you may have to check for every individual subtexture rather than the one in animdefs / the animated one.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Davregis on November 25, 2013, 04:50:36 PM
How do I make a projectile give the class a flag on crash?

class as in the playerclass
Title: Re: The "How do I make a weapon do that?" thread
Post by: tsukiyomaru0 on November 25, 2013, 05:25:38 PM
Quote from: "Davregis"
How do I make a projectile give the class a flag on crash?

class as in the playerclass
Pain state in the class and damage type in the projectile.
Example: if DamageType of the projectile is "GravityBreaker", the playerclass will need a pain state defined "Pain.GravityBreaker", with an A_ChangeFlag action function in said pain state.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Davregis on November 25, 2013, 05:33:33 PM
Quote from: "tsukiyomaru0"
Quote from: "Davregis"
How do I make a projectile give the class a flag on crash?

class as in the playerclass
Pain state in the class and damage type in the projectile.
Example: if DamageType of the projectile is "GravityBreaker", the playerclass will need a pain state defined "Pain.GravityBreaker", with an A_ChangeFlag action function in said pain state.

I referred to the calling playerclass, yet this was part of the solution that resulted. and didn't actually work
An exploding projectile with the painstate as you describe works perfectly. Thanks!
Title: Re: The "How do I make a weapon do that?" thread
Post by: tsukiyomaru0 on November 25, 2013, 05:38:15 PM
Quote from: "Davregis"
Quote from: "tsukiyomaru0"
Quote from: "Davregis"
How do I make a projectile give the class a flag on crash?

class as in the playerclass
Pain state in the class and damage type in the projectile.
Example: if DamageType of the projectile is "GravityBreaker", the playerclass will need a pain state defined "Pain.GravityBreaker", with an A_ChangeFlag action function in said pain state.

I referred to the calling playerclass, yet this was part of the solution that resulted.

An exploding projectile with the painstate as you describe works perfectly. Thanks!
Oh, so you meant give a flag to their master? You need CustomInventory instead. Make a CustomInventory that changes the flag on pickup and have the projectile use A_GiveToTarget said item.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Zard1084 on December 16, 2013, 03:28:49 AM
is it possible to make a weapon that allows the user to steal the enemy's weapons and/or items?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Ceridran on December 16, 2013, 03:42:41 AM
Copy Robot demonstrates something like that in CSCC. Unless you mean to also remove their weapon, too..
Title: Re: The "How do I make a weapon do that?" thread
Post by: Zard1084 on December 16, 2013, 03:55:35 AM
Quote from: "Ceridran"
Copy Robot demonstrates something like that in CSCC. Unless you mean to also remove their weapon, too..
yep it will take there weapon too but not the megabuster because that would be asshole-ish basically it steals the current weapon with a small amount of health but if the enemy has a item like the E-tank it steals that instead with a small amount of health also the weapon will be a melee weapon
Title: Re: The "How do I make a weapon do that?" thread
Post by: Lighjing on December 19, 2013, 07:13:14 AM
This might have been asked already, but I didn't see anything with my browse of it. How would you go about making a weapon deal damage to yourself and people around you, and then healing yourself?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on December 19, 2013, 08:59:08 PM
[Zard]
WELL

First you would want find the target player to check which weapon they have selected by using ACS and the CheckWeapon() (http://zdoom.org/wiki/CheckWeapon) function to check for every weapon in the game. Then you would need to take that weapon away from said player using TakeInventory() (http://zdoom.org/wiki/TakeInventory) and check to see if the attacking player has that weapon, if they do not, give them said weapon.

The most complicated part of all of this would be acquiring the Thing ID of the attacking player, but all of this can be done via ACS...let me just...um...
Put this in the player class:
In "pain.zard" change "zard" to the "damagetype" of your projectile.
You can also change any of the actor names to whatever you wish.
(click to show/hide)
Place this in the class file, but not in its actor definition
(click to show/hide)

Place this in an ACS script somewhere [WCOLORS or GLOBAL if you didn't make your own]:
(click to show/hide)

WHOO...that was a mouthful.
Please note that my code will have some assembly required in terms of creating your pk3. Do not expect it to work straight out of the box.
[especially in these untested incidents...]

[Lighjing]

What you want to do here is relatively simple. Basically, you want to use lots of SetActorProperty() (http://zdoom.org/wiki/SetActorProperty) calls in a couple of ACS scripts called similarly to those listed directly above.
If you need any help, you have someone you can directly ask anyway.

All I can say is you better not be making Mordekaiser >_> <_<
Title: Re: The "How do I make a weapon do that?" thread
Post by: Zard1084 on December 21, 2013, 09:30:59 AM
Quote from: "Lego"
[Zard]
WELL

First you would want find the target player to check which weapon they have selected by using ACS and the CheckWeapon() (http://zdoom.org/wiki/CheckWeapon) function to check for every weapon in the game. Then you would need to take that weapon away from said player using TakeInventory() (http://zdoom.org/wiki/TakeInventory) and check to see if the attacking player has that weapon, if they do not, give them said weapon.

The most complicated part of all of this would be acquiring the Thing ID of the attacking player, but all of this can be done via ACS...let me just...um...
Put this in the player class:
In "pain.zard" change "zard" to the "damagetype" of your projectile.
You can also change any of the actor names to whatever you wish.
(click to show/hide)
Place this in the class file, but not in its actor definition
(click to show/hide)

Place this in an ACS script somewhere [WCOLORS or GLOBAL if you didn't make your own]:
(click to show/hide)

WHOO...that was a mouthful.
Please note that my code will have some assembly required in terms of creating your pk3. Do not expect it to work straight out of the box.
[especially in these untested incidents...]
Ohhh! thanks Lego! this just saved me alot of time! btw i will test this to Death! before releasing the weapon to the public also i will credit you for most of the coding. Thanks!~
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hilman170499 on December 22, 2013, 09:12:31 AM
I got more questions:

1)How do you make a weapon where to fire, the user must tap? When the fire key is held, instead of firing continuously, it would do absolutely nothing.

2)How to make a bouncing projectile that does stuff as it hits a wall?

Thanks in advance.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Knux on December 22, 2013, 09:18:23 AM
You could look at Fake Man's coding in MMPSPSIN for the first one, Hil. Don't know about the second situation, though.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on December 22, 2013, 01:59:57 PM
To be fair, the Fake Buster was made by Uki originally in his weapons pack.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hilman170499 on December 22, 2013, 03:27:32 PM
Yes, Fake's attack did answer my first question. My problem with that is getting consent to borrow coding from there...

(click to show/hide)
Title: Re: The "How do I make a weapon do that?" thread
Post by: Gummywormz on December 22, 2013, 03:32:55 PM
You can try making a "Crash" state, but otherwise bounce states do not yet exist in zandronum.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Ceridran on March 03, 2014, 07:25:03 PM
Far below novice, here. How can I make a weapon regenerate ammo very slowly, (max 28: 1 bar every 2 seconds) but have it regenerate much faster when the player is standing still? (max 28: 3 bars every 1 second)




Also, can this thread get moved to Help & Editing?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Stardust on March 03, 2014, 11:02:50 PM
In your class's Spawn state, use the GiveInventory command to give an inventory flag to your class. Use the TakeInventory command in the Missile and See states of your class to take it back.
In the ready state of your weapon (or whenever you get ammo), use the JumpIfInventory action, and check if you have the inventory flag defined in your class's Spawn state.
If you have it, jump to another state where you'll get more ammo
If you haven't it, keep the slow ammo regeneration
Title: Re: The "How do I make a weapon do that?" thread
Post by: Hilman170499 on March 04, 2014, 08:43:43 AM
I have a question: How to make an inventory item that basically taints the screen a certain colour for a short period?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Stardust on March 04, 2014, 11:46:16 AM
To do it the easy way, you simply need to create a PowerupType item. For instance...
Code: [Select]
actor RollRageMode : PowerupGiver
{
+COUNTITEM
+INVENTORY.AUTOACTIVATE
+INVENTORY.ALWAYSPICKUP
Inventory.MaxAmount 0
Powerup.Type "PowerRollDefense"
Powerup.Color 255 123 255, 0.4
Powerup.Duration -50
States
{
Spawn:
TNT1 A 1
Loop
}
}
This code used by Roll's rage changes the screen to the RGB colors "255 123 255" with an opacity of 40% of the screen. You could have also used a literary value such as "Powerup.Color Pink".
To change the powerup's duration, you use Powerup.Duration. If yo put a "-" in front of the number, it counts in seconds ; otherwise it counts in tics (1 second = 35 tics).
For a simple example, you can simply edit this one :
Code: [Select]
actor MyScreenColorPowerup : Powerup
{
Powerup.Color <RGB or color name here>, <opacity>
Powerup.Duration <duration in seconds or tics>
}
Notice the screen starts flashing when the powerup has 3 seconds left
Title: Re: The "How do I make a weapon do that?" thread
Post by: Beed28 on March 09, 2014, 08:35:13 PM
How would I be able to make it so that when a player does something, all players around a certain distance from him receive an item?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on March 09, 2014, 11:27:33 PM
ACS...more specifically something similar to:

Code: [Select]
int atid = activatorTID();
int p = 0;
for(int i=0; i<64; i++)
{
p = 1000+i;
if(xyzDistance(atid, p)<[number of units goes here])GiveActorInventory(p, "item", number);
}

[xyzDistance is a function defined in the GLOBAL.acs file since MM8BDM-v3a]
[This loop is played 64 times...it would be wise to use the variable ALSO defined in GLOBAL called max_players or something similar.]

That's incredibly simplified, but basically what it does is it loops through all possible players [64] and checks their distance from the activator, and if they are in that distance, give that player the item. Since all players in 8BDM have a thing id based on their player number, this is and easy feat to accomplish.
Title: BUMP: The "How do I make a weapon do that?" thread
Post by: lol on March 18, 2014, 06:51:57 AM
I'm pretty much a complete novice when it comes to coding, so...

Question: Is there a way to use the zoom factor via using inventory?

I know I can simply use the "Altfire" state, but the weapon I am creating is already using the alternative fire for another purpose.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Ceridran on May 09, 2014, 11:49:32 PM
A page back, I asked how to implement ammo regeneration in a somewhat different way.. Well, the answer I got didn't tell me WHAT I should be doing and HOW I should be doing this. This time, I'd like to ask how to give a class ammo regeneration in general.

Alot of times I've looked at the code of classes like Viz, and I'm confused how the ammo regeneration even gets on the class, because there's nothing that seems to support it in the class file. (The part that defines class name, given items, armor and speed, etc.)
Title: Re: The "How do I make a weapon do that?" thread
Post by: Gummywormz on May 10, 2014, 12:15:24 AM
There are a few options. Most actually define ammo regeneration in the class' weapon. The easiest method is to stick on ammo regeneration to the ready state of the weapon like so.

Code: [Select]
TRHU A 3 A_WeaponReady
COOW B 0 A_GiveInventory("BlueFireAmmo",2)
//it's important to stick your wait time on the A_WeaponReady part and not the A_GiveInventory part because otherwise your weapon will only fire some of the time

The downside is that you have to not fire your weapon to get ammo. Viz implements his ammo regen through a flash state like so.

Code: [Select]
Ready:
OBUS A 0 ACS_ExecuteAlways(998,0,600)
OBUS A 0 A_GunFlash

...

Flash:
TNT1 A 0 A_JumpIfInventory("VizPadTimer", 1, 2)
TNT1 A 0 A_GiveInventory("VoltLaserAmmo", 1)
TNT1 A 35
loop

Calling A_GunFlash enters the "Flash" state. This is where ammo regen occurs, independent of movement or firing your weapon. Ammo is always regenerated.
Title: Re: The "How do I make a weapon do that?" thread
Post by: skully on May 17, 2014, 04:49:56 PM
So, i am making a weapon that if the projectile hits the floor, it creates another ripping projectile for others to step in, the thing is i cannot make the second projectile despawn, it is ripping though. halp?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on May 17, 2014, 04:56:36 PM
You know how your set animations? Just make a full animation time [something like TNT1 A 35 which is an invisible sprite that lasts one second] and call stop at the end of the spawn state instead of loop.
Title: Re: The "How do I make a weapon do that?" thread
Post by: skully on May 17, 2014, 07:26:37 PM
Tried, didn't work.
(click to show/hide)
Removing the names just incase.
This actually last forever.

LeEdit: Herpderp, i put'd the loop in here. look!
(i start to feel like an idiot now xP)
(click to show/hide)
Title: Re: The "How do I make a weapon do that?" thread
Post by: Badz on May 27, 2014, 10:04:58 PM
How could I make it so that, if a player is damaged by a particular projectile, it gives a type of ammo to whoever shot the projectile?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Gummywormz on May 27, 2014, 10:35:41 PM
Make a pain state and use A_GiveToTarget.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Ceridran on June 22, 2014, 02:53:35 PM
At this point, I don't even know what to do. My Brawler's Bullet Punch quickly turns into pure awful when you use it in multiplayer. After a moment of working properly, it starts to only fire projectiles and drain no ammo, then it fires no projectiles and drains your ammo.

What I'm asking is-- what's wrong here?

Code: [Select]
Altfire:
FIST A 0 A_JumpIfNoAmmo("NoAmmo")
//FIST A 0 A_GiveInventory("Fury",1)
FIST A 0 SetPlayerProperty(0,1,4)
Goto Althold
Althold:
FIST A 0 A_TakeInventory("Fury",1)
FIST A 0 A_FireCustomMissile("BulletPunchAttack",8,-4,11,6)
FIST BCD 1 A_PlaySoundEx("weapon/pshot","Weapon")
FIST A 0 A_FireCustomMissile("BulletPunchAttack",-4,8,11,-10)
FIST BCD 1 A_PlaySoundEx("weapon/pshot","Weapon")
FIST A 0 A_FireCustomMissile("BulletPunchAttack",-8,4,11,4)
FIST BCD 1 A_PlaySoundEx("weapon/pshot","Weapon")
FIST A 0 A_FireCustomMissile("BulletPunchAttack",4,-8,11,-8)
FIST BCD 1 A_PlaySoundEx("weapon/pshot","Weapon")
FIST A 0 SetPlayerProperty(0,0,4)
FIST A 0 A_Refire
Goto Ready+1
NoAmmo:
FIST B 1 ACS_Execute(979,0)
Goto Ready+1
}
}
Title: Re: The "How do I make a weapon do that?" thread
Post by: Gummywormz on June 22, 2014, 07:10:21 PM
Did you try not using the althold state? It's a bit finicky sometimes.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Jdude330 on July 10, 2014, 06:59:59 PM
How Do I create weapon pickups for my weapons?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on July 10, 2014, 07:05:11 PM
As in...the pickup sprites?
Those are native. The Spawn state defines what the weapon looks like in the field.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Gummywormz on July 14, 2014, 10:44:47 AM
Quote from: "Badz"
How could I make it so that, if a player is damaged by a particular projectile, it gives a type of ammo to whoever shot the projectile?

Welp, it turns out A_GiveToTarget does not work in pain states. Are there any workarounds or can we just not give items when you hit another player?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on July 14, 2014, 01:23:21 PM
Jax created a...unique workaround once that was used for numerous features in CSCC.
Basically, when the player was damaged by a damagetype, they spawned an actor that called A_GiveToTarget to give the struck player an item that would then call A_GiveToTarget to give an item to whoever hit said player.

No one is sure why it works as reliably as it does, but I guess because it adds a delay between the player getting hit and then trying to look for a target.

(click to show/hide)
Title: Re: The "How do I make a weapon do that?" thread
Post by: Jdude330 on July 24, 2014, 09:02:07 PM
NeverMind, I think I can make it work.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Jdude330 on August 11, 2014, 04:08:38 PM
How Do I make a weapon have a cooldown time?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on August 11, 2014, 04:13:52 PM
Under normal circumstances, you would simply want to increase the number of tics used at the end of the firing state, though that may not be what you're asking. Do you want to be able to switch weapons with this cooldown in progress or do you want the weapon to remain selected? The latter is simpler than the former.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Jdude330 on August 11, 2014, 08:21:05 PM
The Latter, I am trying to make a move that can't be Immediately used over and over.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Ceridran on August 11, 2014, 08:36:53 PM
I think you would just have to mess with ammo regen stuff and jumpif lines. You're probably going to want the second thing in this post from Gummywormz.

(click to show/hide)
Title: in before the possibility that I realize this is easy to do
Post by: Ceridran on September 02, 2014, 08:28:12 PM
Hey, so I'm trying to make a projectile that when it hits it's target, it throws both the user and the target in the direction the user is facing. (I also plan on doing one where it's the same, but they go backwards.) I tried some stuff with damagetypes and A_ChangeVelocity, but it didn't work out.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Korby on September 02, 2014, 09:41:46 PM
Does that include pitch, or do you only want horizontal movement?

Will the person hit just copy the shooter's momentum, going the same direction, or will it try to go where the guy is facing, similar to Copy Vision?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on September 02, 2014, 09:46:06 PM
I feel like something like this can only be done through ACS...specifically Arthur's shield in GVHBDM that does something similar where it shoots a projectile that throws the player it hit in the direction it was travelling if you want to use that for reference.
Title: Re: The "How do I make a weapon do that?" thread
Post by: TheDoc on October 03, 2014, 12:58:09 AM
What are the units used to measure radius and height? And, uh, what's scale used for?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Ceridran on October 03, 2014, 01:47:17 AM
Scale affects the size of the sprite itself, as opposed to the entity, which is decided by radius and height. What units are used, I don't actually know.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on October 03, 2014, 01:56:32 AM
The units used for height and radius are in map units. For reference, an airman tile is 32 map units in width, which is twice the tile's width in pixel.
(http://i.imgur.com/HD1aANo.png)
Title: Re: The "How do I make a weapon do that?" thread
Post by: TheDoc on October 03, 2014, 02:29:51 AM
Thanks.

Also, I can't seem to get this operator working:
Code: [Select]
SPAR A 1 A_FaceTarget
WSPA D 0 A_JumpIf(floorz-z!=0,1)
WSPA D 7 A_ChangeVelocity(8.0,0.0,11.0,CVF_REPLACE|CVF_RELATIVE) //Jumping line
WSPA D 0 A_JumpIf(floorz-z==0,"AttackChance")
specifically this second line
Code: [Select]
WSPA D 0 A_JumpIf(floorz-z!=0,1)Instead of skipping the third line and moving to the fourth while the actor is airbourne (because floorz-z does not equal 0), the script keeps going on to the third line anyways, resulting in a never-ending cycle of jumping. Am I using the "!=" operator wrong?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on October 03, 2014, 03:33:45 AM
No, "!=" is correct, it means not equal to.
try z-floorz
subtract actor height in space from the floor height in space to get the distance between the actor and the floor.
Title: Re: The "How do I make a weapon do that?" thread
Post by: TheDoc on October 03, 2014, 04:42:59 AM
I copypasted it from something else, but didn't think to change it bcuz I didn't think it would make a difference so long as it wasn't equal to 0.

But no, it didn't work.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on October 03, 2014, 04:49:29 AM
Try changing the 1 after the expression to a 2. A_Jump functions have always confused me and sometimes they don't work in ways you think they would...
Title: Re: The "How do I make a weapon do that?" thread
Post by: TheDoc on October 03, 2014, 08:32:15 PM
Oh yea it is weird like that isn't it?

Finally it works! Thank you again...but I have one more question :mrgreen:
How does the damage property of an actor work? Specifically, is there a difference between putting damage in parentheses and not?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Ceridran on October 03, 2014, 08:46:11 PM
Far as I know, you need to put it in parentheses, or it ain't gonna recognize it.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on October 03, 2014, 09:56:21 PM
That one actually has a legitimate answer.

By default, there is a damage spread of a randomized value of 1-8 times the given value. In the case of the +STRIFEDAMAGE flag, this value is changed to 1-4 times the given value.
If this value is placed in parenthesis, the randomization is removed.

It's even stated on the wiki, it helps to read. (http://zdoom.org/wiki/actor_properties#Damage)
Title: Re: The "How do I make a weapon do that?" thread
Post by: TheDoc on October 03, 2014, 10:11:01 PM
I actually did read that and apparently missed the parentheses part; sorry bout that :? . Thanks tho
Title: Re: The "How do I make a weapon do that?" thread
Post by: Beed28 on January 12, 2015, 02:33:40 PM
I need help. I'm trying to make a script that checks if the up, down, left or right keys are pressed (and only pressed; not held down) and gives the player a flag item based on which key is pressed for a very brief period. However, I just can't get this working properly, it always acts when the key is held down.

(click to show/hide)
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on January 12, 2015, 02:54:31 PM
First off, the check logic on the keys is wrong. Basically what you would want to do is something along the lines of checking if the button you're checking is among the list of buttons being pressed and what you're checking is if the button you're checking is the only button pressed.
In my work in progress kart racing mod for Doom, my button checks used a statement more like this:
Code: [Select]
if(buttons & BT_FORWARD)Also in the given script, your use of "&" needs to be replaced with "&&." I can't find the words to explain this any better than X&Y basically asks "does X contain Y?" rather than a boolean statement saying "X and Y."

Second, I'm having trouble interpreting what you're trying to ask here:
Code: [Select]
if ((buttons == (BT_FORWARD|BT_BACK|BT_MOVELEFT|BT_MOVERIGHT)) & (keyHold == TRUE))It seems like you're checking to see if any of those buttons are pressed, but...that seems unnecessary because you're doing the same thing below anyway?

Third, the delays after the button statements aren't necessary and might actually cause the response time to get reduced should the button direction get changed.

Finally, I would recommend using a while loop over a restart statement, as that reactivates the script rather than keeping it running in the same instance.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Beed28 on January 12, 2015, 03:46:59 PM
Jeez, I still can't wrap my head around all this. For the second one, it's to try and prevent the keys from being registered held down, but it didn't work.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on January 12, 2015, 04:10:25 PM
Why not just use the boolean you established at the beginning of the script, then?

I mean it's set up to set keypressed to true if any of the valid keys have been pressed, so why need to check if they were already pressed again?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Beed28 on January 12, 2015, 06:43:33 PM
Still very confused. Is there nothing out there I can use for a reference?

The only examples on the ZDoom wiki doesn't look like any examples of button pressing (and not holding).
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on January 13, 2015, 12:36:01 AM
idk man I guess you could do something similar to...

Code: [Select]
script  ENTER
{
If(PlayerIsBot(PlayerNumber())){terminate;}

int keyPressed = 0;

While(true)
{
int buttons = GetPlayerInfo(-1, INPUT_BUTTONS);
if(buttons & BT_FORWARD)
{
if(keypressed==0)
{
GiveInventory("FowardKey",1);
TakeInventory("BackKey", 1);
//The other take lines should be here too
keypressed=1;
}
}


}
}
Title: Re: The "How do I make a weapon do that?" thread
Post by: Beed28 on January 13, 2015, 01:05:03 AM
Well, I asked on the ZDoom forum, and got a working solution at last.

Thank you for the help, anyway.
Title: apologies for the double post
Post by: Beed28 on January 16, 2015, 03:23:43 PM
New situation. How can I make a shield weapon be able to absorb hits while protecting the user from damage?
Title: Re: apologies for the double post
Post by: Megaman94 on January 16, 2015, 03:39:04 PM
Quote from: "Beed28"
New situation. How can I make a shield weapon be able to absorb hits while protecting the user from damage?

Doesn't the leaf shield do that?
Title: Re: apologies for the double post
Post by: Beed28 on January 16, 2015, 06:37:54 PM
Quote from: "Megaman94"
Quote from: "Beed28"
New situation. How can I make a shield weapon be able to absorb hits while protecting the user from damage?

Doesn't the leaf shield do that?
Nope. Leaf Shield reflects certain projectiles. Skull Barrier makes you invincible. Plant Barrier heals you. Junk Shield gives you armour, not exactly what I'm looking for.
Title: Re: The "How do I make a weapon do that?" thread
Post by: Max on January 16, 2015, 06:44:30 PM
Theoretical (AKA I haven't tried this) but you could just make a new type of armour that saves 100 percent of damage form the user and use the save amount as the shield's HP, right?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Megaman94 on April 16, 2015, 06:36:56 PM
Does ReactionTime control how well the Dive Missile hones in on players?
Title: Re: The "How do I make a weapon do that?" thread
Post by: Russel on April 16, 2015, 06:58:44 PM
No.
Reactiontime is a counter set for the action A_CountDown.
Each time A_CountDown is called, it reduces this number by 1. Once this value reaches 0, the projectile it put into its Death state.

With the advent of Zandronum 2.0, the homing method used by Dive Missile, Magnet Missile, and well...every homing weapon ever has become rather antiquated. Currently, the number of times a Dive Missile calls A_MStaffTrack controls how well it homes in. This applies to all of MM8BDM's projectiles as of now.