Advanced Search

Author Topic: The "How do I make a weapon do that?" thread  (Read 91828 times)

0 Members and 1 Guest are viewing this topic.

July 14, 2014, 01:23:21 PM
Reply #495

Offline Russel

  • MM8BDM Extender

  • Doc Croc
  • **********
  • Date Registered: December 17, 2010, 11:11:25 PM

    • View Profile
Re: The "How do I make a weapon do that?" thread
« Reply #495 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)

July 24, 2014, 09:02:07 PM
Reply #496

Offline Jdude330

  • Standard Member
  • Date Registered: July 22, 2013, 12:57:40 PM

    • View Profile
Re: The "How do I make a weapon do that?" thread
« Reply #496 on: July 24, 2014, 09:02:07 PM »
NeverMind, I think I can make it work.

August 11, 2014, 04:08:38 PM
Reply #497

Offline Jdude330

  • Standard Member
  • Date Registered: July 22, 2013, 12:57:40 PM

    • View Profile
Re: The "How do I make a weapon do that?" thread
« Reply #497 on: August 11, 2014, 04:08:38 PM »
How Do I make a weapon have a cooldown time?

August 11, 2014, 04:13:52 PM
Reply #498

Offline Russel

  • MM8BDM Extender

  • Doc Croc
  • **********
  • Date Registered: December 17, 2010, 11:11:25 PM

    • View Profile
Re: The "How do I make a weapon do that?" thread
« Reply #498 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.

August 11, 2014, 08:21:05 PM
Reply #499

Offline Jdude330

  • Standard Member
  • Date Registered: July 22, 2013, 12:57:40 PM

    • View Profile
Re: The "How do I make a weapon do that?" thread
« Reply #499 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.

August 11, 2014, 08:36:53 PM
Reply #500

Offline Ceridran

  • MM8BDM Extender
  • **
  • Date Registered: April 07, 2012, 01:08:52 AM

    • View Profile
    • http://ceridran.tumblr.com/
Re: The "How do I make a weapon do that?" thread
« Reply #500 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)

September 02, 2014, 08:28:12 PM
Reply #501

Offline Ceridran

  • MM8BDM Extender
  • **
  • Date Registered: April 07, 2012, 01:08:52 AM

    • View Profile
    • http://ceridran.tumblr.com/
in before the possibility that I realize this is easy to do
« Reply #501 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.

September 02, 2014, 09:41:46 PM
Reply #502

Offline Korby

  • Global Moderator

  • Benvenuto nella room italiana!
  • *************
  • Date Registered: March 04, 2010, 03:36:02 AM

    • View Profile
    • Korby Games
Re: The "How do I make a weapon do that?" thread
« Reply #502 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?

September 02, 2014, 09:46:06 PM
Reply #503

Offline Russel

  • MM8BDM Extender

  • Doc Croc
  • **********
  • Date Registered: December 17, 2010, 11:11:25 PM

    • View Profile
Re: The "How do I make a weapon do that?" thread
« Reply #503 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.

October 03, 2014, 12:58:09 AM
Reply #504

Offline TheDoc

  • Standard Member
  • Date Registered: August 31, 2011, 10:37:33 PM

    • View Profile
Re: The "How do I make a weapon do that?" thread
« Reply #504 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?

October 03, 2014, 01:47:17 AM
Reply #505

Offline Ceridran

  • MM8BDM Extender
  • **
  • Date Registered: April 07, 2012, 01:08:52 AM

    • View Profile
    • http://ceridran.tumblr.com/
Re: The "How do I make a weapon do that?" thread
« Reply #505 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.

October 03, 2014, 01:56:32 AM
Reply #506

Offline Russel

  • MM8BDM Extender

  • Doc Croc
  • **********
  • Date Registered: December 17, 2010, 11:11:25 PM

    • View Profile
Re: The "How do I make a weapon do that?" thread
« Reply #506 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.

October 03, 2014, 02:29:51 AM
Reply #507

Offline TheDoc

  • Standard Member
  • Date Registered: August 31, 2011, 10:37:33 PM

    • View Profile
Re: The "How do I make a weapon do that?" thread
« Reply #507 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?

October 03, 2014, 03:33:45 AM
Reply #508

Offline Russel

  • MM8BDM Extender

  • Doc Croc
  • **********
  • Date Registered: December 17, 2010, 11:11:25 PM

    • View Profile
Re: The "How do I make a weapon do that?" thread
« Reply #508 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.

October 03, 2014, 04:42:59 AM
Reply #509

Offline TheDoc

  • Standard Member
  • Date Registered: August 31, 2011, 10:37:33 PM

    • View Profile
Re: The "How do I make a weapon do that?" thread
« Reply #509 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.