Custom Inventory & Respawn

Discuss all aspects related to modding Zandronum here.
User avatar
The_Spartan
 
Posts: 79
Joined: Fri Oct 12, 2012 1:12 pm
Location: Italy
Contact:

RE: Custom Inventory & Respawn

#21

Post by The_Spartan » Sat Mar 22, 2014 6:21 pm

Klofkac wrote: It might not be good thing, but try replacing the Stop in PickupWeapon with Fail.
Using this method just keeps the weapon in that position giving me the maximum amount of ammo. But that's not what i was looking for: i want it to respawn after a while giving me a normal ammo as usual.

Klofkac
Forum Regular
Posts: 481
Joined: Sat Jun 09, 2012 1:31 pm
Location: Ask Grandvoid servers

RE: Custom Inventory & Respawn

#22

Post by Klofkac » Sat Mar 22, 2014 8:28 pm

hmm, there is a flag called ALWAYSRESPAWN, not sure if it works with inventory items... It should do the thing, I hope.
And you can use Inventory.RespawnTics for changing the delay when the item appears.
Last edited by Klofkac on Sat Mar 22, 2014 8:29 pm, edited 1 time in total.
𝕂𝕝𝕠𝕗𝕜𝕒𝕔

User avatar
Vincent(PDP)
Forum Regular
Posts: 527
Joined: Thu Mar 14, 2013 7:35 pm
Location: Sweden
Clan: My DOOM site
Clan Tag: <MDS>
Contact:

RE: Custom Inventory & Respawn

#23

Post by Vincent(PDP) » Sun Mar 23, 2014 7:52 am

The_Spartan wrote: They just don't work. I think they do ONLY in Decorate Expressions.

Yes, i can send you the wad. I would be very grateful to you if you could fix this annoying problem for me. Private Message?
Sure, send me a PM with it. :biggrin:
Klofkac wrote: hmm, there is a flag called ALWAYSRESPAWN, not sure if it works with inventory items... It should do the thing, I hope.
And you can use Inventory.RespawnTics for changing the delay when the item appears.
First, ALWAYSRESPAWN is for monsters only.
And second, item respawning gotta be enabled for Inventory.RespawnTics to work.

But i have another idea which probably will make it stay there after picking it up. I'll try it when he PM's me the wad.
Last edited by Vincent(PDP) on Sun Mar 23, 2014 8:01 am, edited 1 time in total.
//Visual Vincent ( Vincent (PDP) )
- My DOOM site Team

My projects:
Spoiler: (Open)
Doom Writer
Escape From The Laboratory - Done
Escape From The Laboratory Part 2
Parkskolan Zombie Horde Map (ZM10) - Done
In game Admin Commands for Zandronum.
Achievement Mod for Zandronum
Stats mod

User avatar
The_Spartan
 
Posts: 79
Joined: Fri Oct 12, 2012 1:12 pm
Location: Italy
Contact:

RE: Custom Inventory & Respawn

#24

Post by The_Spartan » Sun Mar 23, 2014 11:30 am

Tried ALWAYSRESPAWN. It doesn't work.

Anyway, Vincent, I sent you the pk3 :D
Last edited by The_Spartan on Sun Mar 23, 2014 7:40 pm, edited 1 time in total.

User avatar
Vincent(PDP)
Forum Regular
Posts: 527
Joined: Thu Mar 14, 2013 7:35 pm
Location: Sweden
Clan: My DOOM site
Clan Tag: <MDS>
Contact:

RE: Custom Inventory & Respawn

#25

Post by Vincent(PDP) » Wed Mar 26, 2014 1:39 pm

Klofkac wrote: It might not be good thing, but try replacing the Stop in PickupWeapon with Fail.
He's already tried that, read the previous posts...
Fíxed it! :razz:
http://www.mydoomsite.com/WADS/general% ... ch%202.pk3
Last edited by Vincent(PDP) on Wed Mar 26, 2014 2:05 pm, edited 1 time in total.
//Visual Vincent ( Vincent (PDP) )
- My DOOM site Team

My projects:
Spoiler: (Open)
Doom Writer
Escape From The Laboratory - Done
Escape From The Laboratory Part 2
Parkskolan Zombie Horde Map (ZM10) - Done
In game Admin Commands for Zandronum.
Achievement Mod for Zandronum
Stats mod

User avatar
The_Spartan
 
Posts: 79
Joined: Fri Oct 12, 2012 1:12 pm
Location: Italy
Contact:

RE: Custom Inventory & Respawn

#26

Post by The_Spartan » Wed Mar 26, 2014 3:23 pm

I saw, but... It gives the maximum amount of ammo to the picker and just keeps the weapon there. I want the weapon to give you the standard amount of ammo, disappear and then respawn after a while.

User avatar
Vincent(PDP)
Forum Regular
Posts: 527
Joined: Thu Mar 14, 2013 7:35 pm
Location: Sweden
Clan: My DOOM site
Clan Tag: <MDS>
Contact:

RE: Custom Inventory & Respawn

#27

Post by Vincent(PDP) » Wed Mar 26, 2014 5:33 pm

The_Spartan wrote: I saw, but... It gives the maximum amount of ammo to the picker and just keeps the weapon there. I want the weapon to give you the standard amount of ammo, disappear and then respawn after a while.
You said you wanted them to "not disappear"... -.-
Well change the 'Fail' on pickup to 'Stop' and then remove the two slashes before Inventory.RespawnTics
Oh, and on pickup, add:

Code: Select all

WFAX A 0 A_JumpIfInventory("FWeapAxe", 1, "Failing")
Last edited by Vincent(PDP) on Wed Mar 26, 2014 5:37 pm, edited 1 time in total.
//Visual Vincent ( Vincent (PDP) )
- My DOOM site Team

My projects:
Spoiler: (Open)
Doom Writer
Escape From The Laboratory - Done
Escape From The Laboratory Part 2
Parkskolan Zombie Horde Map (ZM10) - Done
In game Admin Commands for Zandronum.
Achievement Mod for Zandronum
Stats mod

User avatar
The_Spartan
 
Posts: 79
Joined: Fri Oct 12, 2012 1:12 pm
Location: Italy
Contact:

RE: Custom Inventory & Respawn

#28

Post by The_Spartan » Wed Mar 26, 2014 8:27 pm

Nothing. It just solved the problem of the ammo and stuff, but the items still don't respawn. I also tried to host a team game server, and they don't respawn there either.

This is the full code:
ACTOR AxeGiver : CustomInventory
{
SpawnID 27
Game Doom
Inventory.RespawnTics 35
Tag "Timon's Axe"
Inventory.PickupMessage "$TXT_WEAPON_F2"
//$Category Weapons
VisibleToPlayerClass "Fighter"
States
{
Spawn:
WFAX A -1
Stop
Pickup:
WFAX A 0 A_JumpIfInventory("ImAMage", 1, "Failing")
WFAX A 0 A_JumpIfInventory("ImACleric", 1, "Failing")
WFAX A 0 A_JumpIfInventory("ImAMarine", 1, "Failing")
WFAX A 0 A_JumpIfInventory("Imbj", 1, "Failing")
WFAX A 0 A_JumpIfInventory("ImCorvus", 1, "Failing")
WFAX A 0 A_JumpIfInventory("FWeapAxe", 1, "Failing")
goto PickupWeapon
Failing:
WFAX A 1
Stop
PickupWeapon:
WFAX A 0 A_GiveInventory("FWeapAxe", 1)
Stop
}
}

User avatar
Vincent(PDP)
Forum Regular
Posts: 527
Joined: Thu Mar 14, 2013 7:35 pm
Location: Sweden
Clan: My DOOM site
Clan Tag: <MDS>
Contact:

RE: Custom Inventory & Respawn

#29

Post by Vincent(PDP) » Thu Mar 27, 2014 12:30 pm

It respawned when i tried it. :/
Did you turn on the Respawn items flag?
Last edited by Vincent(PDP) on Thu Mar 27, 2014 12:30 pm, edited 1 time in total.
//Visual Vincent ( Vincent (PDP) )
- My DOOM site Team

My projects:
Spoiler: (Open)
Doom Writer
Escape From The Laboratory - Done
Escape From The Laboratory Part 2
Parkskolan Zombie Horde Map (ZM10) - Done
In game Admin Commands for Zandronum.
Achievement Mod for Zandronum
Stats mod

User avatar
The_Spartan
 
Posts: 79
Joined: Fri Oct 12, 2012 1:12 pm
Location: Italy
Contact:

RE: Custom Inventory & Respawn

#30

Post by The_Spartan » Thu Mar 27, 2014 8:15 pm

I just turned on +ALWAYSRESPAWN.

I don't think they need those anyway.

User avatar
Popsoap
 
Posts: 86
Joined: Mon Jun 04, 2012 2:38 pm
Location: Inside a wall

RE: Custom Inventory & Respawn

#31

Post by Popsoap » Thu Mar 27, 2014 8:39 pm

Use a RandomSpawner to create the pickups. RandomSpawner clears the DROPPED flag, allowing the item to respawn.

Code: Select all

AxeRandomSpawner : RandomSpawner
{
	DropItem "AxeGiver"
}

User avatar
Vincent(PDP)
Forum Regular
Posts: 527
Joined: Thu Mar 14, 2013 7:35 pm
Location: Sweden
Clan: My DOOM site
Clan Tag: <MDS>
Contact:

RE: Custom Inventory & Respawn

#32

Post by Vincent(PDP) » Thu Mar 27, 2014 9:28 pm

The_Spartan wrote: I just turned on +ALWAYSRESPAWN.

I don't think they need those anyway.
ALWAYSRESPAWN isn't the flag i meant... You gotta turn the respawn items flag on in the "Gameplay Options".
//Visual Vincent ( Vincent (PDP) )
- My DOOM site Team

My projects:
Spoiler: (Open)
Doom Writer
Escape From The Laboratory - Done
Escape From The Laboratory Part 2
Parkskolan Zombie Horde Map (ZM10) - Done
In game Admin Commands for Zandronum.
Achievement Mod for Zandronum
Stats mod

User avatar
The_Spartan
 
Posts: 79
Joined: Fri Oct 12, 2012 1:12 pm
Location: Italy
Contact:

RE: Custom Inventory & Respawn

#33

Post by The_Spartan » Fri Mar 28, 2014 11:59 am

Tried. Still nothing.

I think it's time for "Plan B".

Is there any way I can avoid standard weapons to be picked up from certain classes without using an external pickup method that includes an inventory item?

Klofkac
Forum Regular
Posts: 481
Joined: Sat Jun 09, 2012 1:31 pm
Location: Ask Grandvoid servers

RE: Custom Inventory & Respawn

#34

Post by Klofkac » Fri Mar 28, 2014 1:57 pm

There is a method in latest ZDoom, but of course Zandronum is years behnid so...
𝕂𝕝𝕠𝕗𝕜𝕒𝕔

Gardevoir
Forum Regular
Posts: 184
Joined: Mon Jun 18, 2012 6:30 am
Location: Tekwall4

RE: Custom Inventory & Respawn

#35

Post by Gardevoir » Fri Mar 28, 2014 2:32 pm

I used CustomInventory in my classes mod and it worked just fine.

Code: Select all

ACTOR WeaponID1 : Inventory
{
  Inventory.Amount 1
  Inventory.MaxAmount 1
  +INVENTORY.UNDROPPABLE
}

ACTOR WeaponID2 : Inventory
{
  Inventory.Amount 1
  Inventory.MaxAmount 1
  +INVENTORY.UNDROPPABLE
}

ACTOR WeaponSlot1 : CustomInventory Replaces Chainsaw
{
  Inventory.PickupMessage ""
  
  States
  {
  Spawn:
	CSAW A -1
	Stop
  Pickup:
    TNT1 A 0 A_JumpIfInventory("WeaponID1", 0, "PickupID1")
	TNT1 A 0 A_JumpIfInventory("WeaponID2", 0, "PickupID2")
  PickupID1:
    TNT1 A 0 A_JumpIfInventory("Chainsaw1", 1, "Failure")
	TNT1 A 0 A_GiveInventory("Chainsaw1", 1)
	TNT1 A 0 A_SetBlend("FFFF00", 0.1, 5)
	//TNT1 A 0 A_Log("\cgYou got the chainsaw!") There's no A_Log in Zan 1.2 (it's in 2.0) but I suppose you can use ACS for pickup messages.
	TNT1 A 0 A_PlaySoundEx("misc/w_pkup", CHAN_VOICE)
	Goto Success
  PickupID2:
    TNT1 A 0 A_JumpIfInventory("Chainsaw2", 1, "Failure")
	TNT1 A 0 A_GiveInventory("Chainsaw2", 1)
	TNT1 A 0 A_SetBlend("FFFF00", 0.1, 5)
	//TNT1 A 0 A_Log("\cgYou got another chainsaw!")
	TNT1 A 0 A_PlaySoundEx("misc/w_pkup", CHAN_VOICE)
	Goto Success
  Failure:
    TNT1 A 0
	Fail
  Success:
    TNT1 A 0
	Fail
	}
}
Give WeaponID# items to the classes to make them pick up what you want. If you don't want them to pickup anything I suppose redirecting them to Failure should work. The weapon's going to stay on the map forever no matter how many times you will pick it up.
Last edited by Gardevoir on Fri Mar 28, 2014 3:35 pm, edited 1 time in total.
Never forget... 8.10.2012
(O+|+<) ~*

HI

User avatar
Vincent(PDP)
Forum Regular
Posts: 527
Joined: Thu Mar 14, 2013 7:35 pm
Location: Sweden
Clan: My DOOM site
Clan Tag: <MDS>
Contact:

RE: Custom Inventory & Respawn

#36

Post by Vincent(PDP) » Fri Mar 28, 2014 4:51 pm

He wanted the weapon to disappear for a while, and i already made it work staying...
//Visual Vincent ( Vincent (PDP) )
- My DOOM site Team

My projects:
Spoiler: (Open)
Doom Writer
Escape From The Laboratory - Done
Escape From The Laboratory Part 2
Parkskolan Zombie Horde Map (ZM10) - Done
In game Admin Commands for Zandronum.
Achievement Mod for Zandronum
Stats mod

User avatar
The_Spartan
 
Posts: 79
Joined: Fri Oct 12, 2012 1:12 pm
Location: Italy
Contact:

RE: Custom Inventory & Respawn

#37

Post by The_Spartan » Fri Mar 28, 2014 7:23 pm

Tried something different this time:

DECORATE:
ACTOR AxeGiver : FWeapAxe
{
VisibleToPlayerClass "Fighter"
States
{
Spawn:
TNT1 A 0 A_Jumpif(ACS_ExecuteWithResult(601,1) == 1,"Spawn2")
Stop
Spawn2:
WFAX A -1
Stop
}
}
ACS:
#library "script2"
#include "zcommon.acs"

Script 601 (int arg0)
{
if(PlayerClass(PlayerNumber()) == arg0)
{
SetResultValue(1);
print(s:"yes");
}
else
{
SetResultValue(0);
}
}
Still nothing, probably due to the fact that checks the activator's inventory, being the weapon while it is in the state of Spawn.

User avatar
Vincent(PDP)
Forum Regular
Posts: 527
Joined: Thu Mar 14, 2013 7:35 pm
Location: Sweden
Clan: My DOOM site
Clan Tag: <MDS>
Contact:

RE: Custom Inventory & Respawn

#38

Post by Vincent(PDP) » Sun Mar 30, 2014 3:12 pm

The_Spartan wrote: Tried something different this time:

DECORATE:
ACTOR AxeGiver : FWeapAxe
{
VisibleToPlayerClass "Fighter"
States
{
Spawn:
TNT1 A 0 A_Jumpif(ACS_ExecuteWithResult(601,1) == 1,"Spawn2")
Stop
Spawn2:
WFAX A -1
Stop
}
}
ACS:
#library "script2"
#include "zcommon.acs"

Script 601 (int arg0)
{
if(PlayerClass(PlayerNumber()) == arg0)
{
SetResultValue(1);
print(s:"yes");
}
else
{
SetResultValue(0);
}
}
Still nothing, probably due to the fact that checks the activator's inventory, being the weapon while it is in the state of Spawn.
Well PlayerNumber() checks the activating player's number. And since you did it in an actor's spawn state, there's no activating player. And, if I'm right, the PlayerNumber() will be set to the server (-1).
Last edited by Vincent(PDP) on Sun Mar 30, 2014 3:13 pm, edited 1 time in total.
//Visual Vincent ( Vincent (PDP) )
- My DOOM site Team

My projects:
Spoiler: (Open)
Doom Writer
Escape From The Laboratory - Done
Escape From The Laboratory Part 2
Parkskolan Zombie Horde Map (ZM10) - Done
In game Admin Commands for Zandronum.
Achievement Mod for Zandronum
Stats mod

User avatar
The_Spartan
 
Posts: 79
Joined: Fri Oct 12, 2012 1:12 pm
Location: Italy
Contact:

RE: Custom Inventory & Respawn

#39

Post by The_Spartan » Mon Mar 31, 2014 9:47 am

Well PlayerNumber() checks the activating player's number. And since you did it in an actor's spawn state, there's no activating player. And, if I'm right, the PlayerNumber() will be set to the server (-1).
That's right, and what i'm going to do next? I have no ideas.

User avatar
Vincent(PDP)
Forum Regular
Posts: 527
Joined: Thu Mar 14, 2013 7:35 pm
Location: Sweden
Clan: My DOOM site
Clan Tag: <MDS>
Contact:

RE: Custom Inventory & Respawn

#40

Post by Vincent(PDP) » Mon Mar 31, 2014 11:08 am

Code: Select all

Script 123 OPEN
{
SetActivator(-1);
ConsoleCommand("SV_ItemRespawn 1");
}
Then use RespawnTics on your item
//Visual Vincent ( Vincent (PDP) )
- My DOOM site Team

My projects:
Spoiler: (Open)
Doom Writer
Escape From The Laboratory - Done
Escape From The Laboratory Part 2
Parkskolan Zombie Horde Map (ZM10) - Done
In game Admin Commands for Zandronum.
Achievement Mod for Zandronum
Stats mod

Post Reply