header general

Making items spawn based on character class

  • Ultimate Freedoomer
  • Ultimate Freedoomer's Avatar Topic Author
  • Wraith
  • Wraith
More
7 years 9 months ago #11 by Ultimate Freedoomer
Replied by Ultimate Freedoomer on topic Making items spawn based on character class

MagicWazard wrote: I think I see the problem: the scripts all have a special script type of "Enter", meaning they run as soon as the map starts, and not just when called. They should have the closed type of "(void)", instead, like so:

script "PistolSpawn" (void)

Try changing all the "Enter" to "(void)" and see if that resolves it.

It worked. Now all that's left to do is make it work in multiplayer (the main issue I see here being that you'll have to create an base-actor that AUTOMATICALLY CONVERTS into the appropriate item depending on the player class picking it up, rather than just spawning the appropriate item as in singleplayer).

Please Log in or Create an account to join the conversation.

  • MagicWazard
  • MagicWazard's Avatar
  • Moderator
  • Moderator
More
7 years 9 months ago #12 by MagicWazard
Replied by MagicWazard on topic Making items spawn based on character class

Ultimate Freedoomer wrote: It worked. Now all that's left to do is make it work in multiplayer (the main issue I see here being that you'll have to create an base-actor that AUTOMATICALLY CONVERTS into the appropriate item depending on the player class picking it up, rather than just spawning the appropriate item as in singleplayer).


Pretty much, yes. There is also an ACS function that checks whether you're playing single-player or multiplayer, or what type of multiplayer. So you can have your spawn function check to see which game mode is being played before it spawns an item. If single-player, then it spawns the appropriate weapon for the player's class. If multiplayer, it spawns an item which runs a script on pickup to see which player class is picking it up (probably using CheckActorClass ) and gives that class the appropriate item (probably using GiveInventory ). Now, I've never done this before, so I don't have an exact example, but that should be something to work off of.

Please Log in or Create an account to join the conversation.