Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
Hitscanning_scumbag

Randomized weapon spawns

Question

Hi doom world!

I'm sorry if this has been asked before but I genuinely don't know what to search in this case.

 

so I'm making a samsara-style mod that uses different characters from different games (more or less for myself, but I'm thinking of uploading it)

 

 

Trying to get the crux quickly here, what I'm wondering is how to make it so that each player collects the right weapon for each slot?

(so for example, my mod includes five hero classes: Blake stone, Duke Nukem 3D, Ian-Paul freely,  Caleb From Blood, BJ Blaz from Wolfenstien 3d, and ranger from quake

 

what would I do so that:

Duke - Gets his shotgun from dooms shotgun

BStone - get's slowfire protector from dooms shotgun

Rott - Gets dual Pistols From Dooms Shotgun

BJ - Gets Machine gun from DOOMS shotgun

Quake - Gets Double Shotgun From DOOM's Shotgun)

 

and so on, I hope I made this clear enough, thank you in advance for your answers!

 

 

p.s I've Kind-of figured it by replacing dooms weapons with  the "Replaces" Command, but obviously this wont work for many reasons.

I've included my code beneath, in case it is needed.

 

ACTOR Duke3D_w : Weapon //don't forget to change the Weapon category to "---_w"
{
 +INVENTORY.RESTRICTABSOLUTELY
 Inventory.ForbiddenTo "BDCB"
 Inventory.ForbiddenTo "BStone"
 Inventory.ForbiddenTo "ROTT"
 Inventory.ForbiddenTo "Wolf3D"
 //Inventory.ForbiddenTo "Quake"
 Inventory.RestrictedTo "Duke3D"
 VisibleToPlayerClass "Duke3D"
}

Actor D3DSpawner : RandomSpawner //Replaces Shotgun
 {
  Dropitem "D3DSG"
  Dropitem "D3DTB"
  Dropitem "D3DCG"
  Dropitem "D3DRPG"
  Dropitem "D3DPB"
  Dropitem "D3DSE"
  Dropitem "D3DDR"
  
 }

Edited by zaszthedestroyer : Lack of response

Share this post


Link to post

6 answers to this question

Recommended Posts

  • 1

I would go about something like this:

First, make an item that each character has. (Ex: one called "IsDuke") Then use an actor that derives from custominventory to detect if the player class is holding a certain item and jumps to that state.

Also make an actor that acts as a pickup sprite that's visible to one class so it looks different to each character.

Ex:

Actor ShotSpawner : Custominventory replaces Shotgun

{

States

{

Spawn:

TNT1 A 2

TNT1 A 0 A_spawnitemex("DukeShotfake")

TNT1 A 0 A_Spawnitemex("BlakeShotFake")

//You get it

Loop

Pickup:

TNT1 A 0 A_Jumpifinventory("IsDuke","Duke")

//etc

Stop

Duke:

TNT1 A 0 A_GiveInventory("DukeShotgun")

stop

}}

 

Actor DukeShotFake

{

VisibleToPlayerClass "Duke3D"

States

{

Spawn:

DNSG P 2

Stop

}}

 

Do this for each weapon and class.

 

Share this post


Link to post
  • 1

Omg thank you so much for answering, I was starting to wonder if any saw. Yes!  This is something I had not thought to try and will try it later on today or tomorrow (didn't sleep well last night) 

I cannot stress enough how grateful I am for your answer. 

Share this post


Link to post
  • 0

---SOLVED-----

 

Hey, thank you so much for your help! I forgot to mention I'm in zandronum (due to an old pc) and had to Revise a bit. for those who were wondering, like me, here is the revised code; and thank you again, @Mengo so, so much for your help! *EDIT: sorry it took me so long to respond, I've been helping my dad put siding on the trailer.

//zandy-compatible

Actor ShotgunSpawner : Custominventory replaces shotgun
{

States
{
Spawn:

TNT1 A 2
TNT1 A 0 A_spawnitemex("D3DSHOTPKUP")
TNT1 A 0 A_Spawnitemex("BSSHOTPKUP")
//TNT1 A 0 A_spawnItemEX("Rottpickup")
Loop

Pickup:
TNT1 A 0 A_Jumpifinventory("Player.IsDuke",1,"whenDuke")
TNT1 A 0 A_Jumpifinventory("Player.IsBlake",1,"WhenBlake")
Stop

WhenDuke:
TNT1 A 0 A_GiveInventory("D3DSG")
stop

WhenBlake:
TNT1 A 0 A_Giveinventory("BSSFP")
Stop

}}

//------------------------------
Actor D3DSHOTPKUP : Inventory
{
VisibleToPlayerClass "Duke3D"

States
{
Spawn:
DNSG A 1
Stop

}}

Actor BSSHOTPKUP : Inventory
{
VisibleToPlayerClass "BStone"

States
{
Spawn:
BSFP A 1
Stop

}}

 


//------------------------------------------

Actor Player.IsDuke : inventory
{
Inventory.Amount 1
Inventory.MaxAmount 1
}


Actor Player.IsBlake : inventory
{
Inventory.Amount 1
Inventory.MaxAmount 1
}


 

Share this post


Link to post
  • 0
8 minutes ago, zaszthedestroyer said:

Actor D3DSHOTPKUP : Inventory

{
VisibleToPlayerClass "Duke3D"

States
{
Spawn:
DNSG A 1
Stop

}}

Actor BSSHOTPKUP : Inventory
{
VisibleToPlayerClass "BStone"

States
{
Spawn:
BSFP A 1
Stop

}}

Might wanna change the fake items to be 2 tics instead of 1 so it doesn't flash.

Share this post


Link to post
  • 0

Oh, yea I forgot. I was running it through zandronums pesky debugger and I thought to change it. but for some reason the sprites don't show up on screen.

 

So *for now* I'm not too worried but I will keep this in mind when updating it again. We'll, at least until I CAN work on it. 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×