Advanced Search

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

0 Members and 1 Guest are viewing this topic.

December 16, 2013, 03:28:49 AM
Reply #465

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 #465 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?

December 16, 2013, 03:42:41 AM
Reply #466

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

December 16, 2013, 03:55:35 AM
Reply #467

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

December 19, 2013, 07:13:14 AM
Reply #468

Offline Lighjing

  • Standard Member
  • Date Registered: July 08, 2010, 02:55:50 AM

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

December 19, 2013, 08:59:08 PM
Reply #469

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 #469 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() function to check for every weapon in the game. Then you would need to take that weapon away from said player using 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() 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 >_> <_<

December 21, 2013, 09:30:59 AM
Reply #470

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 #470 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() function to check for every weapon in the game. Then you would need to take that weapon away from said player using 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!~

December 22, 2013, 09:12:31 AM
Reply #471

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

December 22, 2013, 09:18:23 AM
Reply #472

Offline Knux

  • Standard Member
  • *
  • Date Registered: September 04, 2009, 06:56:01 AM

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

December 22, 2013, 01:59:57 PM
Reply #473

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 #473 on: December 22, 2013, 01:59:57 PM »
To be fair, the Fake Buster was made by Uki originally in his weapons pack.

December 22, 2013, 03:27:32 PM
Reply #474

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 #474 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)

December 22, 2013, 03:32:55 PM
Reply #475

Offline Gummywormz

  • Standard Member

  • Air Man Tile Enthusiast
  • Date Registered: December 23, 2010, 01:05:44 AM

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

March 03, 2014, 07:25:03 PM
Reply #476

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 #476 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?

March 03, 2014, 11:02:50 PM
Reply #477

Offline Stardust

  • Enthusiast
  • *
  • Date Registered: July 15, 2012, 07:42:47 AM

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

March 04, 2014, 08:43:43 AM
Reply #478

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 #478 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?

March 04, 2014, 11:46:16 AM
Reply #479

Offline Stardust

  • Enthusiast
  • *
  • Date Registered: July 15, 2012, 07:42:47 AM

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