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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×