(LMS) Disable give player all weapons (SOLVED)

Discuss all aspects related to modding Zandronum here.
Post Reply
Capt.J3
 
Posts: 78
Joined: Wed Jun 06, 2012 1:51 pm
Location: United States

(LMS) Disable give player all weapons (SOLVED)

#1

Post by Capt.J3 » Sun Sep 29, 2013 2:59 am

Hello.

As people know, I am the creator of a wad named "DoomFighters". I've been asked many times to move the gamemode from duel to LMS. I wanted to do this; however, I reached a problem: each class is being given all of the weapons when on LMS; I don't want this, so I am hoping someone here could help me out of this situation. Whomever helps me with this, will be credited in my wad.

Thanks.


EDITED: It's solved. Thank you guys for your support!
Last edited by Capt.J3 on Sun Sep 29, 2013 9:36 pm, edited 1 time in total.

TerminusEst13
Retired Staff / Community Team Member
Posts: 865
Joined: Tue Jun 05, 2012 11:06 pm

RE: (LMS) Disable give player all weapons

#2

Post by TerminusEst13 » Sun Sep 29, 2013 3:11 am

lmsallowedweapons 0
The Ranger - New class for HeXen.
ZDoom Wars - I drew some pictures.
Samsara - Some class-based mod I guess?
Metroid: Dreadnought - I am a dumb fanboy.
DemonSteele - ~come with me to anime world~

User avatar
Hypnotoad
Retired Staff / Community Team Member
Posts: 528
Joined: Tue May 29, 2012 8:50 pm
Location: Britland

RE: (LMS) Disable give player all weapons

#3

Post by Hypnotoad » Sun Sep 29, 2013 3:12 am

Use this: http://wiki.zandronum.com/LMSFlags

Set all the weapons to false.

You can also add clearinventory() to an enter script.

edit: damnit term
Last edited by Hypnotoad on Sun Sep 29, 2013 3:12 am, edited 1 time in total.

Capt.J3
 
Posts: 78
Joined: Wed Jun 06, 2012 1:51 pm
Location: United States

RE: (LMS) Disable give player all weapons

#4

Post by Capt.J3 » Sun Sep 29, 2013 3:18 am

Well, the thing is.. we tried this, but it didn't solve the problem. Will I need to create a script?
Last edited by Capt.J3 on Sun Sep 29, 2013 3:19 am, edited 1 time in total.

Catastrophe
Retired Staff / Community Team Member
Posts: 2571
Joined: Sat Jun 02, 2012 2:44 am

RE: (LMS) Disable give player all weapons

#5

Post by Catastrophe » Sun Sep 29, 2013 3:22 am

Yes. Do clearinventory during the beginning of each round and then give the actual items needed.

Capt.J3
 
Posts: 78
Joined: Wed Jun 06, 2012 1:51 pm
Location: United States

RE: (LMS) Disable give player all weapons

#6

Post by Capt.J3 » Sun Sep 29, 2013 3:28 am

Catastrophe wrote: Yes. Do clearinventory during the beginning of each round and then give the actual items needed.
Thanks. Can someone please wrote me an example on how this code would look like? ( I never created such code before. D:)

User avatar
Hypnotoad
Retired Staff / Community Team Member
Posts: 528
Joined: Tue May 29, 2012 8:50 pm
Location: Britland

RE: (LMS) Disable give player all weapons

#7

Post by Hypnotoad » Sun Sep 29, 2013 3:40 am

Script 1 ENTER
{
clearinventory();
giveinventory("fist", 1);
}

Catastrophe
Retired Staff / Community Team Member
Posts: 2571
Joined: Sat Jun 02, 2012 2:44 am

RE: (LMS) Disable give player all weapons

#8

Post by Catastrophe » Sun Sep 29, 2013 3:41 am

script 1 enter
{
clearinventory();
giveinventory("stuff", 1);
}

http://zdoom.org/wiki/ClearInventory
http://zdoom.org/wiki/GiveInventory

Capt.J3
 
Posts: 78
Joined: Wed Jun 06, 2012 1:51 pm
Location: United States

RE: (LMS) Disable give player all weapons

#9

Post by Capt.J3 » Sun Sep 29, 2013 3:47 am

how would the code be like if you have different classes? is there a special ID or something?

User avatar
Hypnotoad
Retired Staff / Community Team Member
Posts: 528
Joined: Tue May 29, 2012 8:50 pm
Location: Britland

RE: (LMS) Disable give player all weapons

#10

Post by Hypnotoad » Sun Sep 29, 2013 1:21 pm

You mean if you want different classes to get different weapons?

Say you have two fighter classes, one named fighter1 and one named fighter2, with unique weapons fighter1fist and fighter2fist, you could do something like:

Code: Select all

Script 1 ENTER
{
    clearinventory();
    if (CheckActorProperty(0, APROP_NameTag, "fighter1"))
    {
        giveinventory("fighter1fist", 1);
    }
    else if (CheckActorProperty(0, APROP_NameTag, "fighter2"))
    {
        giveinventory("fighter2fist", 1);
    }
}

Capt.J3
 
Posts: 78
Joined: Wed Jun 06, 2012 1:51 pm
Location: United States

RE: (LMS) Disable give player all weapons

#11

Post by Capt.J3 » Sun Sep 29, 2013 2:16 pm

Hypnotoad wrote: You mean if you want different classes to get different weapons?

Say you have two fighter classes, one named fighter1 and one named fighter2, with unique weapons fighter1fist and fighter2fist, you could do something like:

Code: Select all

Script 1 ENTER
{
    clearinventory();
    if (CheckActorProperty(0, APROP_NameTag, "fighter1"))
    {
        giveinventory("fighter1fist", 1);
    }
    else if (CheckActorProperty(0, APROP_NameTag, "fighter2"))
    {
        giveinventory("fighter2fist", 1);
    }
}

AH! Thank you, Hypnotoad! As I promise, I will give you credit for this. What name to you prefer me to use?

User avatar
Hypnotoad
Retired Staff / Community Team Member
Posts: 528
Joined: Tue May 29, 2012 8:50 pm
Location: Britland

RE: (LMS) Disable give player all weapons

#12

Post by Hypnotoad » Sun Sep 29, 2013 4:25 pm

Hypnotoad is fine but no need to credit me really it's just a very simple script.

Capt.J3
 
Posts: 78
Joined: Wed Jun 06, 2012 1:51 pm
Location: United States

RE: (LMS) Disable give player all weapons

#13

Post by Capt.J3 » Sun Sep 29, 2013 6:51 pm

Well then, its up to you.

Anyways I reached yet another problem. The code works on removing the weapons, but its not giving the classes their weapons/fists. Is there something I did wrong?
Spoiler: This is the Acs and the decoration code of the fighter's class (Open)
Script 450 ENTER
{
clearinventory();
if (CheckActorProperty(0, APROP_NameTag, "Normal_Fighter"))
{
giveinventory("Knuckles", 1);
giveinventory("Fist1Offense", 1);
giveinventory("Fist1Defence", 1);
giveinventory("FistStamina", 50);
giveinventory("BlockStamina", 50);
giveinventory("Booster", 1);
giveinventory("AttackMode", 1);
giveinventory("MedKit", 2);
}
else if (CheckActorProperty(0, APROP_NameTag, "Kick_Boxer"))
{
giveinventory("Knuckles2", 1);
giveinventory("Kickboxer", 1);
giveinventory("Kick1Offense", 1);
giveinventory("Kick1Defence", 1);
giveinventory("FistStamina", 50);
giveinventory("BlockStamina", 50);
giveinventory("Booster", 1);
giveinventory("AttackMode", 1);
giveinventory("MedKit", 2);
}
}


ACTOR Normal_Fighter : DoomPlayer
{

Health 235
Radius 16
Height 56
Mass 100
PainChance 355
Speed 0.8
Player.CrouchSprite PL1C
Player.MaxHealth 235
player.runhealth 20
Player.DisplayName "Normal Fighter"
player.forwardmove 0.8 0.8
player.sidemove 0.6 0.6
player.jumpz 8
Player.StartItem "Knuckles"
Player.StartItem "Fist1Offense"
Player.StartItem "Fist1Defence"
Player.StartItem "FistStamina", 50
Player.StartItem "BlockStamina", 50
Player.StartItem "Booster", 1
Player.StartItem "AttackMode", 1
Player.StartItem "MedKit", 2
States
{
Spawn:
PLA1 A -1
Loop
See:
PLA1 ABCD 4
Loop
Missile:
PLA1 F 6 A_JumpIfInventory("Blocker",1,2)
PLA1 E 12
Goto Spawn
PLB1 A 12
PLB1 A 12
Goto Spawn
Melee:
PLA1 E 12
Goto Spawn //Missile
Pain:
PLA1 G 0 ACS_ExecuteAlways(333,0)
PLA1 G 4 A_Jump(180,4)
PLA1 G 15 A_SpawnItemEx("FLYINBLOD", 35,0,80+Random(-50,50),0,0)
PLA1 G 4 A_TakeInventory("FistStamina", 10)
PLA1 G 4 A_Pain
Goto Spawn
PLA1 G 4 A_Jump(200,5)
PLA1 G 15 A_SpawnItemEx("FLYINBLOD", 35,0,80+Random(-50,50),0,0)
PLA1 G 15 A_SpawnItemEx("FLYINBLOD", 15,0,80+Random(-50,50),0,0)
PLA1 G 4 A_TakeInventory("FistStamina", 20)
PLA1 G 4 A_Pain
Goto Spawn
PLA1 G 4 A_Jump(210,4)
PLA1 G 15 A_SpawnItemEx("Atooth", 35,0,80+Random(-50,50),0,0)
PLA1 G 4 A_TakeInventory("FistStamina", 10)
PLA1 G 4 A_Pain
Goto Spawn
PLA1 G 4 A_TakeInventory("FistStamina", 5)
PLA1 G 4 A_Pain
Goto Spawn
Death:
PLA1 G 1
PLA1 G 0 A_Jump(180,13)
PLA1 G 0 ACS_ExecuteAlways(333,0)
DIE1 A 0 A_SpawnItemEx("Atooth", 35,0,80+Random(-50,50),0,0)
PLA1 G 40 A_SpawnItemEx("FLYINBLOD", 35,0,80+Random(-50,50),0,0)
DIE1 A 5 A_PlayerScream
DIE1 B 0 ACS_ExecuteAlways(334,0)
DIE1 B 5 A_NoBlocking
DIE1 C 0 A_SpawnItemEx("Atooth", 45,0,80+Random(-50,50),0,0)
DIE1 C 5 ACS_ExecuteAlways(333,0)
DIE1 D 5
DIE1 E 5
DIE1 D 5
DIE1 E -1
stop
PLA1 G 0 A_Jump(127,12)
PLA1 H 0 ACS_ExecuteAlways(333,0)
PLA1 H 0 A_SpawnItemEx("Atooth", 35,0,80+Random(-50,50),0,0)
PLA1 H 40 A_SpawnItemEx("FLYINBLOD", 35,0,80+Random(-50,50),0,0)
PLA1 I 5 A_PlayerScream
PLA1 I 0 ACS_ExecuteAlways(334,0)
PLA1 J 5 A_NoBlocking
PLA1 J 0
PLA1 K 5 ACS_ExecuteAlways(333,0)
PLA1 L 5
PLA1 M 5
PLA1 M -1
stop
PLA1 H 10 ACS_ExecuteAlways(333,0)
PLA1 H 0 A_SpawnItemEx("Atooth", 35,0,80+Random(-50,50),0,0)
PLA1 H 0 A_SpawnItemEx("FLYINBLOD", 35,0,80+Random(-50,50),0,0)
PLA1 I 10 A_PlayerScream
PLA1 I 0 ACS_ExecuteAlways(334,0)
PLA1 J 10 A_NoBlocking
PLA1 J 0 A_SpawnItemEx("Atooth", 45,0,80+Random(-50,50),0,0)
PLA1 KLM 10 ACS_ExecuteAlways(333,0)
PLA1 M -1
Stop
XDeath:
PLA1 O 0 ACS_ExecuteAlways(334,0)
PLA1 O 5
PLA1 P 5 A_XScream
PLA1 Q 5 A_NoBlocking
PLA1 RSTUV 5 ACS_ExecuteAlways(333,0)
PLA1 W -1
stop
}
}

ACTOR Kick_Boxer : DoomPlayer
{

Health 200
Radius 16
Height 56
Mass 90
PainChance 355
Speed 1.0
Player.CrouchSprite PL2C
Player.MaxHealth 200
Player.DisplayName "Kick Boxer"
player.runhealth 20
player.forwardmove 0.8 0.8
player.sidemove 0.6 0.6
player.jumpz 10
Player.StartItem "Knuckles2"
Player.StartItem "Kickboxer" 1
Player.StartItem "Kick1Offense"
Player.StartItem "Kick1Defence"
Player.StartItem "FistStamina", 50
Player.StartItem "BlockStamina", 50
Player.StartItem "Booster", 1
Player.StartItem "AttackMode", 1
Player.StartItem "MedKit", 2
States
{
Spawn:
PLA2 A -1
Loop
See:
PLA2 ABCD 4
Loop
Missile:
PLA2 F 6 A_JumpIfInventory("Blocker",1,2)
PLA2 E 12
Goto Spawn
PLB2 A 12
PLB2 A 12
Goto Spawn
Melee:
PLA2 E 12
Goto Spawn //Missile
Pain:
PLA2 G 0 ACS_ExecuteAlways(333,0)
PLA2 G 4 A_Jump(180,4)
PLA2 G 15 A_SpawnItemEx("FLYINBLOD", 35,0,80+Random(-50,50),0,0)
PLA2 G 4 A_TakeInventory("FistStamina", 10)
PLA2 G 4 A_Pain
Goto Spawn
PLA2 G 4 A_Jump(200,5)
PLA2 G 15 A_SpawnItemEx("FLYINBLOD", 35,0,80+Random(-50,50),0,0)
PLA2 G 15 A_SpawnItemEx("FLYINBLOD", 15,0,80+Random(-50,50),0,0)
PLA2 G 4 A_TakeInventory("FistStamina", 20)
PLA2 G 4 A_Pain
Goto Spawn
PLA2 G 4 A_Jump(210,4)
PLA2 G 15 A_SpawnItemEx("Atooth", 15,0,80+Random(-50,50),0,0)
PLA2 G 4 A_TakeInventory("FistStamina", 10)
PLA2 G 4 A_Pain
Goto Spawn
PLA2 G 4 A_TakeInventory("FistStamina", 5)
PLA2 G 4 A_Pain
Goto Spawn
Death:
PLA2 G 1
PLA2 G 0 A_Jump(180,13)
PLA2 G 0 ACS_ExecuteAlways(333,0)
DIE2 A 0 A_SpawnItemEx("Atooth", 35,0,80+Random(-50,50),0,0)
PLA2 G 40 A_SpawnItemEx("FLYINBLOD", 35,0,80+Random(-50,50),0,0)
DIE2 A 5 A_PlayerScream
DIE2 B 0 ACS_ExecuteAlways(334,0)
DIE2 B 5 A_NoBlocking
DIE2 C 0 A_SpawnItemEx("Atooth", 45,0,80+Random(-50,50),0,0)
DIE2 C 5 ACS_ExecuteAlways(333,0)
DIE2 D 5
DIE2 E 5
DIE2 D 5
DIE2 E -1
stop
PLA2 G 0 A_Jump(127,12)
PLA2 H 0 ACS_ExecuteAlways(333,0)
PLA2 H 0 A_SpawnItemEx("Atooth", 35,0,80+Random(-50,50),0,0)
PLA2 H 40 A_SpawnItemEx("FLYINBLOD", 35,0,80+Random(-50,50),0,0)
PLA2 I 5 A_PlayerScream
PLA2 I 0 ACS_ExecuteAlways(334,0)
PLA2 J 5 A_NoBlocking
PLA2 J 0
PLA2 K 5 ACS_ExecuteAlways(333,0)
PLA2 L 5
PLA2 M 5
PLA2 M -1
stop
PLA2 H 10 ACS_ExecuteAlways(333,0)
PLA2 H 0 A_SpawnItemEx("Atooth", 35,0,80+Random(-50,50),0,0)
PLA2 H 0 A_SpawnItemEx("FLYINBLOD", 35,0,80+Random(-50,50),0,0)
PLA2 I 10 A_PlayerScream
PLA2 I 0 ACS_ExecuteAlways(334,0)
PLA2 J 10 A_NoBlocking
PLA2 J 0 A_SpawnItemEx("Atooth", 45,0,80+Random(-50,50),0,0)
PLA2 KLM 10 ACS_ExecuteAlways(333,0)
PLA2 M -1
Stop
XDeath:
PLA1 O 0 ACS_ExecuteAlways(334,0)
PLA1 O 5
PLA1 P 5 A_XScream
PLA1 Q 5 A_NoBlocking
PLA1 RSTUV 5 ACS_ExecuteAlways(333,0)
PLA1 W -1
stop
}
}

User avatar
Torr Samaho
Lead Developer
Posts: 1543
Joined: Fri May 25, 2012 6:03 pm
Location: Germany

RE: (LMS) Disable give player all weapons

#14

Post by Torr Samaho » Sun Sep 29, 2013 6:58 pm

A simpler way to prevent the weapons from being given is to create a new player class that it not derived from DoomPlayer or HereticPlayer. This way you shouldn't need any ACS.

Capt.J3
 
Posts: 78
Joined: Wed Jun 06, 2012 1:51 pm
Location: United States

RE: (LMS) Disable give player all weapons

#15

Post by Capt.J3 » Sun Sep 29, 2013 9:34 pm

Torr Samaho wrote: A simpler way to prevent the weapons from being given is to create a new player class that it not derived from DoomPlayer or HereticPlayer. This way you shouldn't need any ACS.
You are right, now the problem is fixed! Thank you! :D

Post Reply