Skulltag Archive

Hosted by Dark-Assassin

The default theme was not avalible in the backup, sorry.
View unanswered posts | View active topics It is currently Fri Nov 22, 2019 2:21 pm



Reply to topic  [ 19 posts ] 
some help with class base wad... 
Author Message

Joined: Wed Dec 31, 1969 6:00 pm
Posts: 243
Reply with quote
iv been working on a class based wad for me and my friends (only me and my friends). and so i was working on it, and i ran into a problem, how do i make it so the weapons i give to a class can only use those weapons, right now im using, a_takeinventory i think it was, and it works, but no the best. is there a better way?

and an another question, how can i add more blood to doom2? i don't like the amount right now as is...


Sun Mar 07, 2010 2:27 am
Profile

Joined: Wed Dec 31, 1969 6:00 pm
Posts: 1420
Reply with quote
Quote:
how do i make it so the weapons i give to a class can only use those weapons, right now im using, a_takeinventory i think it was, and it works, but no the best. is there a better way?

All the answers are here because I didn't want to break the forum layout


Sun Mar 07, 2010 3:12 am
Profile

Joined: Wed Dec 31, 1969 6:00 pm
Posts: 243
Reply with quote
thanks! ill try these out!


Sun Mar 07, 2010 9:10 am
Profile

Joined: Wed Dec 31, 1969 6:00 pm
Posts: 243
Reply with quote
ok, so... about the blood, is this adding more or less?
anywho, i can't use the weapon code, im not sure how to put it into action, i can put bit into the code and everything, and change names up to get it to work, but that's the thing, when I got to add it in, it asks for things that i don't have, like "RunningClassCheck", or stuff like that, would i have to add something to my classes?


Sun Mar 07, 2010 9:50 am
Profile

Joined: Wed Dec 31, 1969 6:00 pm
Posts: 1420
Reply with quote
You have to create those yourself. It's just an inventory item.


Sun Mar 07, 2010 11:03 am
Profile

Joined: Wed Dec 31, 1969 6:00 pm
Posts: 697
Reply with quote
Basicly it is like almost anything that can be used for a checker, a "ammo", a "inventory item", a "weapon", anything that will be placed into your inventory.

But i normaly use ammo one, no idea why, since others work as easy too.

Code:
Actor RunningClassCheck : ammo
{
   Inventory.Amount 1
   Inventory.MaxAmount 1
   +INVENTORY.UNDROPPABLE
}


You would need the Inventory.UnDroppable in so people can not drop the checker so they can pick up the weapon.


Sun Mar 07, 2010 2:56 pm
Profile

Joined: Wed Dec 31, 1969 6:00 pm
Posts: 243
Reply with quote
ok, so the "runningclasschecker" is that stand alone, or do i change running or something to my class name...


anywho, thanks for the help! i just want a bit of help still, here is what i have as one of the classes
Code:
ACTOR shotgunner : DoomPlayer
{
Speed .9
Health 115
Radius 16
Height 56
Mass 100
PainChance 255
Player.ColorRange 122, 127
Player.DisplayName "shotgunner"
Player.CrouchSprite "PLYC"
Player.StartItem "Frinesi Special 12"
Player.StartItem "Wolfram P2K"
Player.StartItem "Tazer"
Player.StartItem "doom3shot"
Player.StartItem "12Shell", 50
Player.StartItem "0.50 nitro" 50
Player.StartItem "0.43", 250
States
{
Spawn
PLAY A -1
Loop
See:
TNT1 A 0 A_TakeInventory("AT 420 Sentinel")
TNT1 A 0 A_TakeInventory("SSR 4000")
TNT1 A 0 A_TakeInventory("Raptor Magnum")
TNT1 A 0 A_TakeInventory("Circular Saw")
TNT1 A 0 A_TakeInventory("MB pow 90")
TNT1 A 0 A_TakeInventory("GL40")
TNT1 A 0 A_TakeInventory("RL22")
TNT1 A 0 A_TakeInventory("Deutche M45")
TNT1 A 0 A_TakeInventory("Deutche SA90")
TNT1 A 0 A_TakeInventory("Sovietic KA-57")
TNT1 A 0 A_TakeInventory("Meyer Bullpup")
TNT1 A 0 A_TakeInventory("Delta 900")
TNT1 A 0 A_TakeInventory("MagnumRevolver")
TNT1 A 0 A_TakeInventory("Holland and Holland")
PLAY ABCD 4
Loop
Missile:
PLAY E 12
Goto Spawn
Melee:
PLAY F 6 BRIGHT
Goto Missile
Pain:
Goto Spawn
Death:
PLAY H 0 A_PlayerSkinCheck("AltSkinDeath")
Death1:
PLAY H 10
PLAY I 10 A_PlayerScream
PLAY J 10 A_NoBlocking
PLAY KLM 10
PLAY N -1
Stop


there is more like altskindeath xdeath, but that is kind of self explanatory. so, now how would i put the weapons with this class, as you can see as of right now i am using A_TakeInventory but that is kind of messy to me, and the way you guys put it would be fantastic! but i have no idea how to weave the two together, yet. any help would be nice

(p.s. on the new blood actor, it seems to make less blood, is there a way to make more, i tried fiddling with it but no idea what to do here too. :lol:


Sun Mar 07, 2010 6:06 pm
Profile

Joined: Wed Dec 31, 1969 6:00 pm
Posts: 243
Reply with quote
any help? i am still using the old way because i still can't seem to incorperate this new code :(


Fri Mar 12, 2010 9:35 pm
Profile

Joined: Wed Dec 31, 1969 6:00 pm
Posts: 676
Reply with quote
Not reading the topic, I gather this:

Code:
actor Flyswatter : DoomPlayer //guy with guns
{
  player.startitem "FlyswatterToken"
  player.startitem "FlyswatterGun"
}

actor TankDude : DoomPlayer //guy with other guns
{
  player.startitem "TankDudeToken"
  player.startitem "TankDudeGun"
}

actor FlyswatterToken : Inventory {} //for the pickup to check
actor TankDudeToken : Inventory {}

actor ShotgunSpawner : CustomInventory replaces Shotgun //custom inventory for advanced pickups
{
  states
  {
  Spawn:
   PACK A -1
   stop
  Pickup: //for when it's picked up
   TNT1 A 0 A_JumpIfInventory ("ShotgunToken", 1, "Out") //make sure we don't already have the shotgun
   TNT1 A 0 A_JumpIfInventory ("FlyswatterToken", 1, "Fly") //for the flyguy
   TNT1 A 0 A_JumpIfInventory ("TankDudeToken", 1, "Tank") //for the other guy
   //fail //if you don't want people that aren't flies or tanks to pickup these; failing a pickup will keep it where it is instead of removing it
  Shotgun: //intentional fall through
   TNT1 A 0 A_GiveInventory ("Shotgun", 1) //but let's give them a shotgun, just to be nice
   goto PickupOut
  Fly: //flyguy
   TNT1 A 0 A_GiveInventory ("BeeGun", 1)
   goto PickupOut
  Tank: //tankdude
   TNT1 A 0 A_GiveInventory ("ShellVulcan", 1)
   goto PickupOut
  PickupOut: //for the sound
   TNT1 A 0 A_PlaySound ("misc/w_pkup")
  Out: //intentional fall through; this state's for the token
   TNT1 A 0 A_GiveInventory ("ShotgunToken", 1) //to make sure they can't pick this up again
   fail
  }
}

actor ShotgunToken : Inventory {inventory.maxamount 1} //let's not forget this; let's also not bog the players down with them, even if it does nothing


Remember to define your player classes in KEYCONF!


Sat Mar 13, 2010 2:28 pm
Profile

Joined: Wed Dec 31, 1969 6:00 pm
Posts: 243
Reply with quote
thanks for the help it is a lot less mucky now! i have a few questions about your example, one when you put "Fly: //flyguy" why would it be Fly? Or Tank for tankdude? what if my guys name was say... sniper?


Sat Mar 13, 2010 7:51 pm
Profile

Joined: Wed Dec 31, 1969 6:00 pm
Posts: 676
Reply with quote
It doesn't matter what the state's name is, just that it's jumped to when the proper token is there.


Sat Mar 13, 2010 8:06 pm
Profile

Joined: Wed Dec 31, 1969 6:00 pm
Posts: 243
Reply with quote
woops sorry! I just saw that part of the code lol! thanks for the help!

edit:
as well, this is great for pickups, but if i want a guy to only have certain weapons would this work?? like the class magician can only have the weapon magicstaff? and when he goes over other weapons he dosn't pick them up, as i said before the way i am doing it is a bit to sloppy. so if i set the part shotgunspawner to another weapon, it would replace it, but i only want to add the function of a certain weapon can only be used by a certain class, ill try this out and see how it goes.


Sat Mar 13, 2010 9:02 pm
Profile

Joined: Wed Dec 31, 1969 6:00 pm
Posts: 243
Reply with quote
ok, so i have not yet tried out the method you guys told me, yet, but i thaught of this other way that i might give a go. sothis is my mage playerclass with this new method

actor mage : doomplayer
{
Speed 1.2
Health 90
Radius 16
Height 56
Mass 95
PainChance 255
Player.ColorRange 112, 127
Player.DisplayName "mage"
Player.CrouchSprite "PLYC"
Player.StartItem "SpellBinder"
Player.StartItem "SkullStaff"
Player.StartItem "JadeWand"
Player.StartItem "Clip", 50
Player.WeaponSlot 1, NULL
Player.WeaponSlot 2, NULL
Player.WeaponSlot 3, NULL
Player.WeaponSlot 4, NULL
Player.WeaponSlot 5, JadeWand, SkullStaff, SpellBinder
Player.WeaponSlot 6, NULL
Player.WeaponSlot 7, NULL
States
{
Spawn:
PLAY A -1
Loop
See:
PLAY ABCD 4
Loop
Missile:
PLAY E 12
Goto Spawn
Melee:
PLAY F 6 BRIGHT
Goto Missile
Pain:
PLAY G 4
PLAY G 4 A_Pain
Goto Spawn
Death:
PLAY H 0 A_PlayerSkinCheck("AltSkinDeath")
Death1:
PLAY H 10
PLAY I 10 A_PlayerScream
PLAY J 10 A_NoBlocking
PLAY KLM 10
PLAY N -1
Stop
XDeath:
PLAY O 0 A_PlayerSkinCheck("AltSkinXDeath")
XDeath1:
PLAY O 5
PLAY P 5 A_XScream
PLAY Q 5 A_NoBlocking
PLAY RSTUV 5
PLAY W -1
Stop
AltSkinDeath:
PLAY H 6
PLAY I 6 A_PlayerScream
PLAY JK 6
PLAY L 6 A_NoBlocking
PLAY MNO 6
PLAY P -1
Stop
AltSkinXDeath:
PLAY Q 5 A_PlayerScream
PLAY R 0 A_NoBlocking
PLAY R 5 A_SkullPop
PLAY STUVWX 5
PLAY Y -1
Stop
}
}


it worked at first, if i ran over an object it said i got it but i could never select it. then i added bots... well they would run over a weapon, in one map it was the ssg, when a bot ran over it, he could use it! i this a problem with my system or is it a problem with the bot? as well, is there a way to set the default weapons as NULL, like making an actor that replaces the shotgun ect. ect. and making it a NULL thing??


Sun Mar 14, 2010 1:21 am
Profile

Joined: Wed Dec 31, 1969 6:00 pm
Posts: 676
Reply with quote
...what.

Are you checking for the weapon you're supposed to be given by checking for the classes's starting weapon? Because otherwise I don't see how what you have would work.

Also, why does the class start with all the weapons it has binded? You're supposed to bind a weapon to be able to use it.

You should post the weapon giver code so as for us to see what you did wrong.


Sun Mar 14, 2010 10:20 am
Profile

Joined: Wed Dec 31, 1969 6:00 pm
Posts: 697
Reply with quote
Ok.
What you can add to your class is this:

Code:
  Player.StartItem "CorvusKey"


Or change the Item to whatever you want it to.
Now lets say the "Key", which i have definded it, should be for the mage,
Then you can actually name it as you will, but i like to keep order.

Code:
  Player.StartItem "MageKey"


Thats one of the items it could spawn with.

Now the MageKey needs to be defined

Code:
actor MageKey : Ammo
{
  inventory.amount 1
  inventory.maxamount 1
  +INVENTORY.UNDROPPABLE
}


Something like that.
The +Inventory.Undroppable makes so you can not drop the "Key" so a weapon not meant for the class can be picked up.

This is my weapon spawner in one of my other wads im making:

Open me to see the code


I made the replace a other weapon in the game i make it for, Hexen.
Now as you can see in that i it has 2 a_jumpifinventory, in it cause it needs to check whatever class.
The states are not needed to be called those, but i just wanted to keep it orderd.
XutaWoo already said that they aint needed and what the Fail does.
Now lets say you have a "Key" for mage and doomguy.
It could look like this:

Open me to see the code


Remember it can always be changed to something else.

I hope this helps a bit more, but i can always try to help more if needed.

Also the problem with the bots is this, they do not use the same way of preffered weapons that you do probably, they would automaticly switch to a weapon they pick up if it is better than the one that held before they ran over.


Sun Mar 14, 2010 11:56 am
Profile

Joined: Wed Dec 31, 1969 6:00 pm
Posts: 243
Reply with quote
oh! ok that makes helps a lot! so i would give the mage class the magekey, then if he ran over whatever weapon, i can use this and he will get a weapon that only the mage class can get because he will only have the key! and with the part that goes
" TNT1 A 0 A_JumpIfInventory("Skullstaff",1,"Failer")
TNT1 A 0 A_GiveInventory ("Skullstaff")
TNT1 A 0 A_PlaySound ("misc/w_pkup")
Fail
Failer:
TNT1 A 0"
that failer part is pretty much like NULL where they get nothing?
thakns for the help, ill post my wad as a before this and after this info!


Sun Mar 14, 2010 3:33 pm
Profile

Joined: Wed Dec 31, 1969 6:00 pm
Posts: 243
Reply with quote
ok so wait, before i test this method out two questions, first: the fail part, so if the person has no magekey, will he get no weapon, because i want it so no one can pick up any new eapons, they will already have the ones they can use, kinda like tf2. and second, will the bots start bieng wierd again and start using what ever they feel like using?


Sun Mar 14, 2010 3:54 pm
Profile

Joined: Wed Dec 31, 1969 6:00 pm
Posts: 243
Reply with quote
well, i tried but i epicly failed, but i just propably screwed something up :P. so, i really want this to happen so, here is my wad, only the mage class has this method and only one weapon has this method, the skullstaff, http://www.mediafire.com/?czjwtmnjnmc
thanks for bieng nice and helping so far, i have learned a LOT from this already.


Sun Mar 14, 2010 5:37 pm
Profile

Joined: Wed Dec 31, 1969 6:00 pm
Posts: 697
Reply with quote
Ok, i can try and write the code as it should be in your wad so you can see how to do it by the next classes.

But you should not triple post, there is a edit button in the lower right cornor of the post you made


Sun Mar 14, 2010 11:58 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 19 posts ] 

Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.