Page 1 of 1

Wad problems

Posted: Thu Dec 12, 2013 3:20 pm
by Mr.Man
I got a code for a weapon, but it doesnt work. So why not ask it in a thread as always...

So this weapon did not have a code, its code fully by me. Im not a pro in it, so it might be something dumb.

The primary fire fires as usual, the secondary should reload it.

Could someone fix it?
and maybe even make a code for the alien? the alien is supposed to be a class[/size]

http://www.mediafire.com/download/xxxxx ... xxxxxxxxxx

(yes, im making a mod)

RE: Weapon fix

Posted: Thu Dec 12, 2013 4:11 pm
by IdeIdoom
You want people to make a code for your rifle or edit the code so the weapon acts good?
If the latter one, there is no code in it.

RE: Weapon fix

Posted: Thu Dec 12, 2013 5:42 pm
by CloudFlash
Protip: put a_giveinventory("shotalready",1) in fire state and a_takeinventory("shotalready",999) in altfire.
Didn't even bother to dl the wad, so forgive me if you figured that out already.

RE: Weapon fix

Posted: Thu Dec 12, 2013 7:00 pm
by Mr.Man
I have a code in there, it just doesnt work. I have no idea why, because the origional worked (it was a different weapon of mine, similar to the shotgun in ZH). I just edited all names and functions.

I havent used the giveinventory, is that really neccesary? Im only having the problem that the weapon pops up anyway, the rest MUST be working, because i didnt skip anything, i think.

EDIT: how many of those items should i put in max? the amound 1 clip holds?

RE: Weapon fix

Posted: Thu Dec 12, 2013 7:58 pm
by CloudFlash
Yes, the amount one clip holds. Also I forgot to mention you should put an a_jumpifinventory("shotalready",<max clip size>,"Make a clicking sound/Reload/Fail") before the actual fire happens, else it will keep shooting while ignoring clip size.

RE: Weapon fix

Posted: Thu Dec 12, 2013 8:18 pm
by Mr.Man
Yes, and a seperate actor to define shotalready. But that doesnt fix the weapon, does it? I guess its part of it, but it doesnt pop up at all when i summon it and such.

RE: Weapon fix

Posted: Fri Dec 13, 2013 6:45 am
by CloudFlash
Of course it won't spawn, since this is a 'behind-the-scenes' thing that players shouldn't be able to pick up anyway. All it needs to do is exist so players can obtain it while shoting and lose it when reloading.
Also it should give the 'shots even without ammo in clips' effect, and that was the objective, right?

RE: Weapon fix

Posted: Fri Dec 13, 2013 7:13 pm
by Mr.Man
Alright, RainboW fixed it for me. I had made a small mistake in coding:

Code: Select all

actor AlienRifle : Weapon
{
  obituary "%o ran into %k and %p alien rifle"
  Weapon.AmmoType1 ""
  Weapon.AmmoType2 "ArifleClipIn"
  Weapon.AmmoUse 0
  Weapon.AmmoUse2 0
     States
     {
        Ready:
                CHGG A 0 A_JumpIfInventory("ArifleClipIn",0,"ReadyFull")
        CHGG A 1 A_WeaponReady
        Loop
        ReadyFull:
                CHGG A 1 A_WeaponReady(WRF_NOSECONDARY)
                Wait
        Deselect:
        CHGG A 1 A_Lower
                Loop
        Select:
        CHGG A 1 A_Raise
        Loop
        Fire:
        CHGG A 0 A_JumpIfInventory("ArifleClipIn",1,3)
        CHGF A 1 A_PlayWeaponSound("weapons/noammo")
        Goto AltFire
                CHGF B 0 Bright
                CHGF B 0 A_PlayWeaponSound("TERIFLE/fire")
        CHGF B 1 A_FireBullets (5.0, 5.0, 8, 10, "BulletPuff2")
        CHGF B 0 A_TakeInventory("ArifleClipIn",1)
        Goto Ready
        AltFire:
        MISF B 0 A_JumpIfInventory("ArifleClipIn",8,2)
        MISF B 0 A_JumpIfInventory("AlienRifle",1,2)
        MISF B 0
        Goto Ready
        MISF B 1 A_PlayWeaponSound("TERIFLE2")
        MISF C 1
        MISF D 1
        MISF A 0 A_GiveInventory("ArifleClipIn",30)
        MISF A 0 A_JumpIfInventory("ArifleClipIn",8,2)
        MISF A 0 A_JumpIfInventory("AlienRifle",1,1)
        MISF A 0
        Goto Ready
     }
}
 
Actor ArifleClipIn : Ammo
{
+INVENTORY.IGNORESKILL
Inventory.MaxAmount 30
}
Apart from that i also forgot to include the file in the decorate, sot hats why it also didnt pop up. Im keeping this thread open for more problems, in case i encounter some. I dont feel like making 500 threads for this :l
1 small problem in that code.

The reload doesnt work, which is just a messy mistake by me. I copied the shotgun acs from ZH, but i dont get the actuall reload real good. I want it to top off on 30 shots whenever you reload it.

RE: Weapon fix

Posted: Fri Dec 13, 2013 7:52 pm
by CloudFlash
Mr.Man wrote:

Code: Select all

        AltFire:
        MISF B 0 A_JumpIfInventory("ArifleClipIn",8,2)
        MISF B 0 A_JumpIfInventory("AlienRifle",1,2)
        MISF B 0
        Goto Ready
        MISF B 1 A_PlayWeaponSound("TERIFLE2")
        MISF C 1
        MISF D 1
        MISF A 0 A_GiveInventory("ArifleClipIn",30)
        MISF A 0 A_JumpIfInventory("ArifleClipIn",8,2)
        MISF A 0 A_JumpIfInventory("AlienRifle",1,1)
        MISF A 0
        Goto Ready
1: Why does the weapon have to check if it is in players' inventory if player is using its altfire? This is just useless, unless you know how to use weapon's altfire without having the weapon ._.
2: Why does it have to check anything else after it gives you back full clip? This is just useless, since altfire state already finished it's job and you have full clip again ._.

RE: Weapon fix

Posted: Fri Dec 13, 2013 8:05 pm
by Ænima

Code: Select all

    AltFire:
        MISF B 0 A_JumpIfInventory("ArifleClipIn",8,2)
        MISF B 0 A_JumpIfInventory("AlienBullets",1,2)
        MISF B 0
        Goto Ready
        MISF B 1 A_PlayWeaponSound("TERIFLE2")
        MISF C 1
        MISF D 1
    Load:
        MISF A 0 A_TakeInventory("AlienBullets",1)
        MISF A 0 A_GiveInventory("ArifleClipIn",1)
        MISF A 0 A_JumpIfInventory("ArifleClipIn",8,2)
        MISF A 0 A_JumpIfInventory("AlienBullets",1,"Load")
        MISF A 0
        Goto Ready
Fixed. Feel free to replace "AlienBullets" with whatever ammo is supposed to be used to load it. You're welcome.

RE: Weapon fix

Posted: Fri Dec 13, 2013 8:50 pm
by Mr.Man
Hmm is doesnt seem to work. I use a bit of modified script to make everything work, that might be the problem. Here is what i have:

Code: Select all

actor Rifle : Weapon
{
	obituary "%o ran into %k and %p rifle"
	Weapon.AmmoType1 "RifleClipIn"
	Weapon.AmmoUse 0
	Weapon.AmmoGive 30
	
	States
	{
	Ready:
		CHGG A 0 A_JumpIfInventory("RifleClipIn",0,"ReadyFull")
		CHGG A 1 A_WeaponReady
		Loop
		
	ReadyFull:
		CHGG A 1 A_WeaponReady(WRF_NOSECONDARY)
		Wait
		
	Deselect:
		CHGG A 1 A_Lower
		Loop
		
	Select:
		CHGG A 1 A_Raise
		Loop
		
	Fire:
		CHGG A 0 A_JumpIfInventory("RifleClipIn",1,3)
		CHGF A 1 A_PlayWeaponSound("weapons/noammo")
		Goto AltFire
		
		CHGF B 1 Bright
		CHGF B 1 A_PlayWeaponSound("rifle/fire")
		CHGF B 4 A_FireBullets (5.0, 5.0, 1, 10, "BulletPuff2")
		CHGF A 4
		CHGF A 0 A_TakeInventory("RifleClipIn",1)
		Goto Ready

	/*AltFire:
        MISF B 0 A_JumpIfInventory("RifleClipIn",8,2)
        MISF B 0 A_JumpIfInventory("RifleBullets",1,2)
        MISF B 0
        Goto Ready
        MISF B 1 A_PlayWeaponSound("rifle2")
        MISF C 1
        MISF D 1
    Load:
        MISF A 0 A_TakeInventory("RifleBullets",1)
        MISF A 0 A_GiveInventory("RifleClipIn",1)
        MISF A 0 A_JumpIfInventory("RifleClipIn",8,2)
        MISF A 0 A_JumpIfInventory("RifleBullets",1,"Load")
        MISF A 0
        Goto Ready*/
	}
}
 
Actor RifleClipIn : Ammo
{
	+INVENTORY.IGNORESKILL
	Inventory.MaxAmount 30
}
EDIT: it might be whatever is in
CHGG A 0 A_JumpIfInventory("RifleClipIn",1,3)
CHGF B 4 A_FireBullets (5.0, 5.0, 1, 10, "BulletPuff2")
MISF A 0 A_TakeInventory("RifleBullets",1)
MISF A 0 A_GiveInventory("RifleClipIn",1)
MISF A 0 A_JumpIfInventory("RifleClipIn",8,2)
MISF A 0 A_JumpIfInventory("RifleBullets",1,"Load")

because i did not touch those, it doesnt show what it loads either.
i really suck on my first time of coding D:[/size]

RE: Weapon fix

Posted: Fri Dec 13, 2013 9:57 pm
by Ænima
Mr.Man wrote:

Code: Select all


	Fire:
		CHGG A 0 A_JumpIfInventory("RifleClipIn",1,3)
		CHGF A 1 A_PlayWeaponSound("weapons/noammo")
		Goto AltFire
		
		CHGF B 1 Bright
		CHGF B 1 A_PlayWeaponSound("rifle/fire")
		CHGF B 4 A_FireBullets (5.0, 5.0, 1, 10, "BulletPuff2")
		CHGF A 4
		CHGF A 0 A_TakeInventory("RifleClipIn",1)
		Goto Ready
	}
}

1. Why did you completely comment out the reload states?
2. "CHGG A 0 A_JumpIfInventory("RifleClipIn",1,3)" in the Fire state is jumping too many frames. It only needs to jump 2 frames, not 3.

RE: Weapon fix

Posted: Sat Dec 14, 2013 10:25 am
by Mr.Man
Yeah, thats what i ment. I copied the shotgun code of Zombie Horde, because it had a reload. However, it only reloads 1 bullet per loops. Like i said, i did not touch that part, because i never did an altfire.

but we all have to start somewhere, right? :s

EDIT: i see that doomcenter uses the reload for the uac rifle different. It seems to fill up the slots with cardridges. Would that be better?

EDIT 2: This is off-topic, but i dont want to make a thread for such small thing. My flat textures turn to "unknown" when i save them in my wad. How do i fix that?

RE: Weapon fix

Posted: Sat Dec 14, 2013 3:29 pm
by IdeIdoom
To your last question: Did you add the TEXTUREx patch file? With the markers that correspond to the flat textures start and end?

Wad problems

Posted: Sun Dec 15, 2013 7:57 pm
by Mr.Man
Renaming this to "wad problems", because it seems like there are quite some issues regarding my wad.

1. The reload of the weapon
2. Flat texture turns unknown.
3. My pk3 wont load in DoomBuilder
4. The claw weapon (name is Alien) chooses a target, and everytime i attack it points towards that target.

So far i have this for a while now, it seems like something uncommon too.