Advanced Search

Author Topic: [Suggestion] Modder's Delight: Item Spawn Func  (Read 313 times)

0 Members and 1 Guest are viewing this topic.

March 27, 2020, 02:34:33 AM
Read 313 times

Offline JaxOf7

  • MM8BDM Extender

  • ****
  • Date Registered: March 23, 2011, 03:56:13 AM

    • View Profile
[Suggestion] Modder's Delight: Item Spawn Func
« on: March 27, 2020, 02:34:33 AM »
So basically, if you ever wanted to make this game's weapon pickups do anything special, you were going to run into problems.
It's 80+ weapons! That's a lot of things to either replace or doomednums to override!
And the wepacs (ammo get), sbarinfo (ammo bars), and campaign only work with the weapons' specific names!
So what I'm proposing is a universal "spawnfunc" that applies to all spawning pickups. Like an ENTER script but for pickups.

https://cdn.discordapp.com/attachments/228999599459794944/692202364894969876/ModdersDelight-8bdmv5d-Pickup2.pk3
(there's a note inside on changes, for implementation's sake and in case i need to do this again...)
This makes a modder's life much easier.
Here are several examples of things that are much easier with this system in play.
Maybe you'd like to implement one of these for the sake of it being easy with this system...

https://cdn.discordapp.com/attachments/228999599459794944/691813632475922525/MD-MinimapIcons.pk3
Self explanatory.

https://cdn.discordapp.com/attachments/228999599459794944/692177382328500245/MD-MagicCardGrab.pk3
Magic Card carries items.

https://cdn.discordapp.com/attachments/228999599459794944/692162030110769162/MD-MapWeaponsOption.pk3
Turn off the map's weapons with the flick of a cvar. mm8bdm_sv_removeweps

https://cdn.discordapp.com/attachments/228999599459794944/692162084171022379/MD-MapWeaponsAreStartWeapons.pk3
No cvar this time, all a map's weapons are just the player's on spawn.

https://cdn.discordapp.com/attachments/228999599459794944/692916938313302036/MD-DroppedFade.pk3
Dropped things fade over time. Handy when people are playing classes so the map doesn't clog.

https://cdn.discordapp.com/attachments/228999599459794944/692916970168909875/MD-FadePossessedWeps.pk3
Map Weapons are faded if you have them. This code kind of makes my head hurt though...

https://cdn.discordapp.com/attachments/228999599459794944/691813652201734225/MD-BouncingItems.pk3
Like Kirby Air Ride, I don't know.

March 27, 2020, 12:35:30 PM
Reply #1

Offline CutmanMike

  • Administrator

  • :dozercool:

  • ******
  • Date Registered: December 17, 2008, 12:24:34 PM

    • View Profile
    • http://cutstuff.net
Re: [Suggestion] Modder's Delight: Item Spawn Func
« Reply #1 on: March 27, 2020, 12:35:30 PM »
Probably going to answer my own question here, but is there any reason the base inventory items have to give themselves a custominventory (to be replaced by modders) instead of just running a named ACS script? AFAIK named acs scripts can be replaced the same way as DECORATE actors if they share the same name and are loaded on top. I'm guessing if one were to say, combine two of the above mods, it would be a lot easier to make a compatibility patch file that just replaces the custominventory and adds a line for both scripts the mods are wanting each item to execute. But I was wondering if there were any other reasons beyond that?

March 27, 2020, 11:26:45 PM
Reply #2

Offline JaxOf7

  • MM8BDM Extender

  • ****
  • Date Registered: March 23, 2011, 03:56:13 AM

    • View Profile
Re: [Suggestion] Modder's Delight: Item Spawn Func
« Reply #2 on: March 27, 2020, 11:26:45 PM »
Reason 1: Non-ACS uses
https://cdn.discordapp.com/attachments/228999599459794944/693234306855862332/MD-BouncingItemsNoACS.pk3
This doesn't use acs at all, and map weapons option just uses a cvar check. (Could probably adapt other things to this method...)
Having to rev up that acs for an acs replacement when you're doing non-acs stuff seems kind of lame.
Reason 2: ACS execution speed
https://cdn.discordapp.com/attachments/228999599459794944/693234327101767751/MD-TimingTest.pk3
Spawn something with this loaded, you'll find that the print2 is 1 tic later than the log and print1.
Because Print2 is ExecuteAlways while Print1 is ExecuteWithResult.
Isn't that weird?
I mean it seems like a lot riding on how the script is called, why not let modders make that decision?
---
Aside from that
The base inventory just calling a script is still 100x better than what we currently have so I would approve of it anyway.

March 28, 2020, 12:34:17 AM
Reply #3

Offline CutmanMike

  • Administrator

  • :dozercool:

  • ******
  • Date Registered: December 17, 2008, 12:24:34 PM

    • View Profile
    • http://cutstuff.net
Re: [Suggestion] Modder's Delight: Item Spawn Func
« Reply #3 on: March 28, 2020, 12:34:17 AM »
By the way, as discovered by Celebi you'll have problems if you don't put a tic before the A_Jump(256, "Spawn2"). Try dropping the items in game via the console, it will have the base icon. Can only imagine other methods of spawning them would cause the same thing.

Anyway we'll check this one out as it's not very intrusive.

March 30, 2020, 06:23:32 AM
Reply #4

Offline JaxOf7

  • MM8BDM Extender

  • ****
  • Date Registered: March 23, 2011, 03:56:13 AM

    • View Profile