Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Announcements and Showcase
Simple weapon system

dekon_17
Registered User
Quote
2021-11-24 19:39:18

So... Yeah, this is my biggest project I was working on so far. And nah, this isn't a game, only a demonstration. There was a thread, called "CC: perfect for your 90s first-person shooter". And there was this:
Plot twist: Niko maybe didn't include very much features probably because he wanted the users to actually be productive and make their own assets & scripts.


And... Yeah, I did the weapon system that allows to make simple weapons pretty fast One step to make FPS creation easier!

First of all, there's a link to download (comes with script and a demonstration .CCB file):
https://disk.yandex.ru/d/2AkY32C...

Now, about the properties:
FullAuto - makes your weapon automatic. Surprized?
AutoReload - weapon will reload once it's mag is empty (or do nothing if reserves are empty).
HasFullReload - played some realistic games? There is probably two reload types in them: one if there is some ammo in a mag, other one if the mag is empty. That's what this thing does. At least you can make different time for each reloading.
ShootDelayMs - basicly a firerate, bruh.
ReloadTimeMs - time of normal reloading.
FullReloadTimeMs - time of full reloading. Being used if "HasFullReload" is true.
AmmoVar - CopperCube variable that stores the reserve ammo for your weapon.
MagAmmoVar - CopperCube variable that stores the ammo from your magazine.
AdditionalBlockVar - variable that will block shooting (but not reloading). Can be used to make safe mode for weapon.
MaxAmmoMag - maximum value of ammo that can be stored in magazine.
OnShoot / OnReloadStart / OnReloadEnd - actions being exhibited during those phases (shooting, starting reload, finalizing reload).

Demonstration controls:
WASD - guess what.
R - reload.
Q - lower weapon (can't shoot, can reload).
LMB - ...should I even say what it does?

The script is not ideal (same goes to the weapon model and animations), probably. Mostly because it was mostly done in one day using some of my other scripts (and now I want commit no live anymore, lol). Still, I think I will update it sometimes.

O-oh, how could I forget about saying:
F e e l F r e e T o U s e

🔎︎



dekon_17
Registered User
Quote
2021-12-15 09:46:51

Hey-o! Long time no see, but hey, I had a plenty of work on this... thing. So, here we are, first updeate!

https://disk.yandex.ru/d/3kPDW2R...

Changes:

- Instead of "SWS_Block" there is now "this.SWS_Block".

- All the actions now have currentNode parameter - the weapon node.

- You are no longer need to change animations in actions, instead you choose them in behavior (more about that in "New stuff", written right after "Changes").

- Basic SWS for mag-fed weapons if now SWSm (Simple weapon system for magazine-fed weapons).

- If I am correct, there may be some small changes too.

Now to some New stuff:
- SWStc, or Simple Weapon System for tube/clip-fed weapons. This new behavior allows you to make shotguns with per-shell reload or a rifle, which can be fully reloaded with a clip (works like magazine reload). See "SWStc properties" below to understand what almost every property does.

- Select animations for shooting and reloading in behavior instead of manual change in actions, triggered by behavior. Note: "PerBulletReloadTimeMs" should match the time of "PerBulletReloadAnimation".

- Updated demonstration: added shotgun (model source: https://www.cgtrader.com/free-3d...) and reworked assault rifle (let's not question the full reload, okay?). Weapon can be selected with plane meshes: move close enough to them while cursor is on them and press E.

New properties:

HasReloadEndAnimation (SWSm) - if true, you can use reload end animation (which is added too) that will play after reload (cosmetic thing, maybe will delete soon if it will be considered useless).

ReloadButtonIDVar - first step on making customizable controls. Write variable in this string that will contain the ID of button, which starts reload. If string is empty, behavior will set the reload on R key.

ReloadBlockVar - prevents reloading, kinda similar to "AdditionalBlockVar".

ReloadStartTimeMs (SWStc) - time of preparing weapon to reload.

ReloadEndTimeMs (SWStc) - time of preparing weapon to shoot after reload is finished.

PerBulletReloadTimeMs (SWStc) - time on loading each shell (or bullet) into weapon.

InstantFullReload (SWStc) - if true and no ammo left in weapon, reloading will be like a magazine variant.

Allright, that should be all the new things I added. Tell me what you think of this system, maybe some suggestions.

That's all for now, see ya!


just_in_case
Moderator
Quote
2021-12-15 11:03:04

This is amazing, I just tried the demo file and it works like charm. Will play with it furthermore and will provide my feedback :)


Aiming_bullets
Guest
Quote
2021-12-15 12:20:05

Thanks, this is awesome ????


Dabady
Guest
Quote
2021-12-23 16:25:59

bruh


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internationa?" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact