Advanced Search

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

0 Members and 2 Guests are viewing this topic.

March 13, 2013, 09:24:11 AM
Reply #345

Offline Zard1084

  • Donator

  • The world is pain...
  • *
  • Date Registered: August 24, 2012, 11:25:00 PM

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

March 13, 2013, 05:22:33 PM
Reply #346

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 #346 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.

March 13, 2013, 05:36:44 PM
Reply #347

Offline Zard1084

  • Donator

  • The world is pain...
  • *
  • Date Registered: August 24, 2012, 11:25:00 PM

    • View Profile
    • http://www.youtube.com/user/Zard1084
Re: The "How do I make a weapon do that?" thread
« Reply #347 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

March 15, 2013, 03:56:30 PM
Reply #348

Offline Hilman170499

  • MM8BDM Extender

  • BLUE FOR DAYS!!!
  • **
  • Date Registered: March 18, 2012, 05:49:26 AM

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

March 15, 2013, 04:36:52 PM
Reply #349

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 #349 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.

March 19, 2013, 12:56:18 AM
Reply #350

Offline Caprice

  • Enthusiast

  • open hole
  • *****
  • Date Registered: May 28, 2011, 10:52:19 PM

    • View Profile
    • i left my soda in the freezer oh no!!
Re: The "How do I make a weapon do that?" thread
« Reply #350 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.

March 19, 2013, 05:02:36 AM
Reply #351

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 #351 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.

March 24, 2013, 04:09:02 PM
Reply #352

Offline Caprice

  • Enthusiast

  • open hole
  • *****
  • Date Registered: May 28, 2011, 10:52:19 PM

    • View Profile
    • i left my soda in the freezer oh no!!
Re: The "How do I make a weapon do that?" thread
« Reply #352 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")

March 24, 2013, 04:16:08 PM
Reply #353

Offline Ivory

  • MM8BDM Extender
  • *********
  • Date Registered: August 25, 2009, 08:17:59 AM

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

March 24, 2013, 04:21:58 PM
Reply #354

Offline Caprice

  • Enthusiast

  • open hole
  • *****
  • Date Registered: May 28, 2011, 10:52:19 PM

    • View Profile
    • i left my soda in the freezer oh no!!
Re: The "How do I make a weapon do that?" thread
« Reply #354 on: March 24, 2013, 04:21:58 PM »
Ah, that explains things. I'll figure out another way to bypass this.

March 24, 2013, 06:55:03 PM
Reply #355

Offline tsukiyomaru0

  • MM8BDM Extender
  • *
  • Date Registered: November 07, 2010, 05:01:56 PM

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

April 10, 2013, 09:57:02 AM
Reply #356

Offline HellHawkX

  • Standard Member
  • Date Registered: November 23, 2010, 11:15:38 AM

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

April 10, 2013, 01:05:30 PM
Reply #357

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 #357 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

April 10, 2013, 06:02:59 PM
Reply #358

Offline Hallan Parva

  • MM8BDM MM8 Contributor

  • drifting absently across an endless sea
  • *
  • Date Registered: September 23, 2010, 10:32:40 PM

    • View Profile
Re: The "How do I make a weapon do that?" thread
« Reply #358 on: April 10, 2013, 06:02:59 PM »
How do you make an item trigger from a weapon's FIRE state, like Beat Support?

April 10, 2013, 06:08:07 PM
Reply #359

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 #359 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.