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

some new problems with my DECORATE code...

Recommended Posts

Okay, so I wrote some code to make a weapon for my fantasy game, but for some reason the weapons fire and flash states will not execute when the player presses the fire button. The weapons ready state and spawn states are working.

My code for the weapon is as follows...

//1 - Jade Wand
ACTOR JadeWand : Weapon 20021
{
Inventory.PickupMessage "Jade Wand Added To Inventory"
Inventory.PickupSound "inv/weaponPickup"
Weapon.SlotNumber 1
Weapon.AmmoGive 10
Weapon.AmmoUse 1
Weapon.AmmoType "Clip"
States
{
Ready:
JADE A 1 A_WeaponReady
Loop
Select:
JADE A 1 A_Raise
Loop
Deselect:
JADE A 1 A_Lower
Loop
Fire:
JADE B 0 A_GunFlash
JADE B 3 A_PlaySound("weap/jadeFire", CHAN_WEAPON)
JADE A 0 A_ReFire
Goto Ready
Flash:
JADE B 1 Bright A_Light1
JADE B 1 Bright A_Light2
Goto LightDone
Spawn:
JDWD A -1
Stop
}
}

If anyone wants to refine this further, that is fine with me.

Share this post


Link to post

Start by posting the DECORATE script (within code tags), that might be all we need to see.

Share this post


Link to post
iAmCodeMonkey666 said:

what do the code tags look like?

[code] [/code] - they're handy if you want/need to preserve the formatting of quoted text.

<script language="Javascript">
<!--
alert("Hello world!");
//-->
</script>
Try replacing Goto LightDone with Stop

Share this post


Link to post
GreyGhost said:

[code] [/code] - they're handy if you want/need to preserve the formatting of quoted text.

<script language="Javascript">
<!--
alert("Hello world!");
//-->
</script>
Try replacing Goto LightDone with Stop


Not a good idea. The LightDone state resets the weapon's extra light and stops the animation immediately. That's certainly not the problem here.

Share this post


Link to post

You are aware that your attack state does not actually contain an attack, right? It just displays the muzzle flash and play a sound, but it does not fire a hitscan or shoot a projectile or anything else that can actually damage foes.

Share this post


Link to post
Graf Zahl said:

The LightDone state resets the weapon's extra light and stops the animation immediately.

That's something new I've learnt today.

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
×