New gun item

  • I managed to get this item in the game after using the Potato Cannon source, however, I can't make it do any aiming when holding right click, and it won't do damage. I'm pretty stumped as to what to do next, so any tips (or help) are/is appreciated!
    yahwho or red51 - You might know something about this?


    yellow51

    Lead Developer & Owner of Bytewerkz Ltd. (based in Colorado, United States).

    Multiplayer/Netcode Programmer & Logic Programmer for Zombie Survival Game Online (ZSGO).

    Edited 2 times, last by yellow51 ().

  • Take a look at Example: Potato Cannon  :thumbup:

    I know about the potato cannon - that's the code used to make this (I took the potato cannon source and changed up the model and textures).
    I just seem to be having problems getting it to sight in (right click zoom in), and also do damage like the Semi-Auto Rifle.

    yellow51

    Lead Developer & Owner of Bytewerkz Ltd. (based in Colorado, United States).

    Multiplayer/Netcode Programmer & Logic Programmer for Zombie Survival Game Online (ZSGO).

  • I just seem to be having problems getting it to sight in (right click zoom in)

    Implementing proper aiming for custom weapons is tricky... unfortunately it's not sufficient to set an aim animation, it's also necessary to modify the body position for that. The API, however, does not offer a way to do that smoothly. Basically you could bind that as secondary action (setSecondaryAction()), i.e. change the item/body position when the secondary action is triggered, but this won't give a satisfying result...


    We'll provide more control over these things in the new API though ;)


    and also do damage like the Semi-Auto Rifle.

    When shooting the rifle (i.e. in the setPrimaryAction() callback) you can spawn an actual projectile by calling World.spawnProjectile(). If you set the projectile id of the semi-auto rifle (5), it will behave like that (and it also deals the same amount of damage).

  • Implementing proper aiming for custom weapons is tricky... unfortunately it's not sufficient to set an aim animation, it's also necessary to modify the body position for that. The API, however, does not offer a way to do that smoothly. Basically you could bind that as secondary action (setSecondaryAction()), i.e. change the item/body position when the secondary action is triggered, but this won't give a satisfying result...


    We'll provide more control over these things in the new API though ;)


    When shooting the rifle (i.e. in the setPrimaryAction() callback) you can spawn an actual projectile by calling World.spawnProjectile(). If you set the projectile id of the semi-auto rifle (5), it will behave like that (and it also deals the same amount of damage).

    Thank you for the infos!

    yellow51

    Lead Developer & Owner of Bytewerkz Ltd. (based in Colorado, United States).

    Multiplayer/Netcode Programmer & Logic Programmer for Zombie Survival Game Online (ZSGO).

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!