Chameleon.h | inactive | new mods will ship with builds

Released modifications for the OpenSpades client.
Forum rules
Release, download, and praise or criticize completed modifications. For installation and creation help, please visit the OpenSpades general discussion forum.
142 posts Page 3 of 10 First unread post
Chameleon
Modder
Modder
Posts: 601
Joined: Thu Nov 22, 2012 6:41 pm


Yes... View.as is a script file that is compiled on launch and that has most of animations in it.
To be honest, it is insanely hard to write animation just by using command line, but, as you see, it is possible.
It took me a lot more than 100 launches of OS to get this AK animation, so it is long and hard, but interesting task :)
Anyway,
@SovietMarmalade make models then tell me (PM or Email) what do you want them to do and I'll either give you instructions or do it myself.
@bloodfox what exactly do you want to do? An example would be great. You got me interested.
Also I'll let you know that sprinting animation is in BasicViewWeapon.as under
Code: Select all
Matrix4 GetViewWeaponMatrix() {
bloodfox
Post Demon
Post Demon
Posts: 2206
Joined: Mon Oct 21, 2013 4:32 pm


Chameleon wrote:
Yes... View.as is a script file that is compiled on launch and that has most of animations in it.
To be honest, it is insanely hard to write animation just by using command line, but, as you see, it is possible.
It took me a lot more than 100 launches of OS to get this AK animation, so it is long and hard, but interesting task :)
Anyway,
@SovietMarmalade make models then tell me (PM or Email) what do you want them to do and I'll either give you instructions or do it myself.
@bloodfox what exactly do you want to do? An example would be great. You got me interested.
Also I'll let you know that sprinting animation is in BasicViewWeapon.as under
Code: Select all
Matrix4 GetViewWeaponMatrix() {
Ok, thx man. For example, I want the sprinting animation so that when you sprint the weapon face downwards instead of side ways. And about the third person mod, I will PM you more info about it.
Chameleon
Modder
Modder
Posts: 601
Joined: Thu Nov 22, 2012 6:41 pm


Replace lines in BasicViewWeapon.as with these:
Code: Select all
if(sprintState > 0.f)
{
mat *= CreateRotateMatrix(Vector3(1.f, 0.f, 0.f), sprintState); 
//rotates the gun downwards
mat *= CreateTranslateMatrix(Vector3(0.f, -1.f, 0.5f) * sprintState); 
//moves the gun 1.0 towards eyepoint and 0.5 downwards
}
ofc I can get you the full file if you need it
bloodfox
Post Demon
Post Demon
Posts: 2206
Joined: Mon Oct 21, 2013 4:32 pm


Ok, sure. Thanks alot man! :D It is cool, but I want to see you have it for each weapon and tool. Thanks! :D
Hot Dog
Blue Master Race
Blue Master Race
Posts: 83
Joined: Sun Dec 22, 2013 2:36 am


I'm pretty blown away by that ak, it's pretty amazing what can be achieved with scripting.
Speaking of which, do either of you mind if I use that sprinting script?
bloodfox
Post Demon
Post Demon
Posts: 2206
Joined: Mon Oct 21, 2013 4:32 pm


It's fine I am guessing. Tbh, you don't need my permission because I don't have ownership over that script
Warp
Green Master Race
Green Master Race
Posts: 704
Joined: Mon May 19, 2014 4:07 pm


Chameleon, can you help me adapt my FAL to use a similar animation- I have looked at all the AK files, but there are new custom KV6's I don't entirely understand. :D
Chameleon
Modder
Modder
Posts: 601
Joined: Thu Nov 22, 2012 6:41 pm


Hot Dog - Everyone is welcome to use (and modify) my scripts/models/whatever. If you want to publish a weapon/script that is heavily based on mine, you are welcome to do so, but please give credit.
Warp - I'll see what I can do, though can't really tell you when I'll finish it.
*EDIT* I will need to change a lot of stuff, so I guess it's +- a month for final release.
Warp
Green Master Race
Green Master Race
Posts: 704
Joined: Mon May 19, 2014 4:07 pm


Chameleon wrote:
Hot Dog - Everyone is welcome to use (and modify) my scripts/models/whatever. If you want to publish a weapon/script that is heavily based on mine, you are welcome to do so, but please give credit.
Warp - I'll see what I can do, though can't really tell you when I'll finish it.
*EDIT* I will need to change a lot of stuff, so I guess it's +- a month for final release.
I don't necessarily need you to do it for me- Green_Happy1 - could you give me any advice on what the models are and whether I have to change the script?
Chameleon
Modder
Modder
Posts: 601
Joined: Thu Nov 22, 2012 6:41 pm


Well I am actually more than halfway trough the script and model editing.
I have working animations, cocking handle moves when reloading, magazine is EXACTLY where it should be, gun rotates when reloading. Also I halved the size of models - they don't cover as much screen. What is left to do is at least cleaning up Scope.kv6 model (I might even replace it), making left arm to move where I need it to when cocking the handle and move the right hand out of the way when I am reloading. Here are your models, scripts and proper folder structure Blue_Happy3 :
https://www.dropbox.com/s/ycq9aj2zb0txv ... a.zip?dl=0

Replying to your last post... If you want to do scripting, you must know C++ or AngelScript (both are very similar).

Click "OpSp&TpSd SMG shoot&reload animation" on my signature or click "Show". I know the text ain't easy, but it's almost everything you need for now.
Spoiler:
You might have noticed that my WeaponNoMagazine has twice the detail - that has been done by adding "CreateScaleMatrix(0.5f)" and doubling the size of model in Slab6. Then I cloned WeaponNoMagazine.kv6, added moving parts and erased the rest of weapon, saved as WeaponMove.kv6. Then I added these lines under "ViewSMGSkin(...){addhere}" in View.as
"@movemodel = renderer.RegisterModel
("Models/Weapons/SMG/WeaponMove.kv6");"
Game will find another model called WeaponMove.kv6, located in /Models/Weapons/SMG/ directory. Simple.
Skip to "void AddToScene() {". Here you can see I modified positions and scale of arms, weapon and sight models. Eliminated the drawing of front ring sight.
Skip to "//NEW ANIMATION"
RELOAD
I changed the left hand coordinates so the hand "moves" my WeaponMove.kv6 model - so it doesn't move by itself.
Then I started off by declaring my model's coordinates, scale & other parameters (see below).
After that, I checked if reloading has started. If true, it waits until reload progress is = 1.9 and starts moving my weapmove model backwards. When reload progress reaches 2.2, weapmove model starts moving back to original position, 2.5 being the end of reload progress.
SHOOTING
I checked if user has fired a bullet by checking if he is NOT ready to fire one YET. i know its stupid, but hey, its working ("float ReadyState", see below). weapmove model moves backwards until half of next bullet is loaded. then from half to finish weapmove model moves forwards. by automatic fire you wil ensure that weapmove model is never idle, working 30 rounds per magazine.

Now lets get into what variable does what and what values of that variable will do what.
"param" or "param.matrix" stores data about current weapon model. etc. Scale, XYZ coordinates and some idk stuff (below).
"weapMatrix" tells that that model should behave like a weapon part (for sprinting animations).
"bool reloading" false=not reloading, true=reloading.
"float reload" tells the progress of current reload. when you press R, you start with 0.f. Search for "reload *= 2.5f;".
"float per" tells the progress of current stage of reload. used to smoothen out the action for animation.
"CreateTranslateMatrix(1.f, -0.1f, 2*0.0f);" tells the coordinates of model. let me get more in-depth.
CreateTranslateMatrix(x.f, y.f, z.f) - (x,y,z) (x+left/-right, y+further/-closer, z+down/-up). do i need to tell you what is + and -?
"CreateScaleMatrix(0.5f)" is used for scaling models up and down, up and down. current value is 2:1 scale
"float ReadyState" you have to declare it first in order to be able to use it!!! it is in grenade and block script. it is 0.f right after shooting and 1.f when you are ready to shoot/throw/build/spade next bullet/grenade/block.
"renderer.AddModel(movemodel, param);" tells renderer to finally add our moving model with "param"eters we entered.
Warp
Green Master Race
Green Master Race
Posts: 704
Joined: Mon May 19, 2014 4:07 pm


Chameleon wrote:
Well I am actually more than halfway trough the script and model editing.
I have working animations, cocking handle moves when reloading, magazine is EXACTLY where it should be, gun rotates when reloading. Also I halved the size of models - they don't cover as much screen. What is left to do is at least cleaning up Scope.kv6 model (I might even replace it), making left arm to move where I need it to when cocking the handle and move the right hand out of the way when I am reloading. Here are your models, scripts and proper folder structure Blue_Happy3 :
https://www.dropbox.com/s/ycq9aj2zb0txv ... a.zip?dl=0

Replying to your last post... If you want to do scripting, you must know C++ or AngelScript (both are very similar).

Click "OpSp&TpSd SMG shoot&reload animation" on my signature or click "Show". I know the text ain't easy, but it's almost everything you need for now.
Spoiler:
You might have noticed that my WeaponNoMagazine has twice the detail - that has been done by adding "CreateScaleMatrix(0.5f)" and doubling the size of model in Slab6. Then I cloned WeaponNoMagazine.kv6, added moving parts and erased the rest of weapon, saved as WeaponMove.kv6. Then I added these lines under "ViewSMGSkin(...){addhere}" in View.as
"@movemodel = renderer.RegisterModel
("Models/Weapons/SMG/WeaponMove.kv6");"
Game will find another model called WeaponMove.kv6, located in /Models/Weapons/SMG/ directory. Simple.
Skip to "void AddToScene() {". Here you can see I modified positions and scale of arms, weapon and sight models. Eliminated the drawing of front ring sight.
Skip to "//NEW ANIMATION"
RELOAD
I changed the left hand coordinates so the hand "moves" my WeaponMove.kv6 model - so it doesn't move by itself.
Then I started off by declaring my model's coordinates, scale & other parameters (see below).
After that, I checked if reloading has started. If true, it waits until reload progress is = 1.9 and starts moving my weapmove model backwards. When reload progress reaches 2.2, weapmove model starts moving back to original position, 2.5 being the end of reload progress.
SHOOTING
I checked if user has fired a bullet by checking if he is NOT ready to fire one YET. i know its stupid, but hey, its working ("float ReadyState", see below). weapmove model moves backwards until half of next bullet is loaded. then from half to finish weapmove model moves forwards. by automatic fire you wil ensure that weapmove model is never idle, working 30 rounds per magazine.

Now lets get into what variable does what and what values of that variable will do what.
"param" or "param.matrix" stores data about current weapon model. etc. Scale, XYZ coordinates and some idk stuff (below).
"weapMatrix" tells that that model should behave like a weapon part (for sprinting animations).
"bool reloading" false=not reloading, true=reloading.
"float reload" tells the progress of current reload. when you press R, you start with 0.f. Search for "reload *= 2.5f;".
"float per" tells the progress of current stage of reload. used to smoothen out the action for animation.
"CreateTranslateMatrix(1.f, -0.1f, 2*0.0f);" tells the coordinates of model. let me get more in-depth.
CreateTranslateMatrix(x.f, y.f, z.f) - (x,y,z) (x+left/-right, y+further/-closer, z+down/-up). do i need to tell you what is + and -?
"CreateScaleMatrix(0.5f)" is used for scaling models up and down, up and down. current value is 2:1 scale
"float ReadyState" you have to declare it first in order to be able to use it!!! it is in grenade and block script. it is 0.f right after shooting and 1.f when you are ready to shoot/throw/build/spade next bullet/grenade/block.
"renderer.AddModel(movemodel, param);" tells renderer to finally add our moving model with "param"eters we entered.
Thanks, this is epic! I will remake the Scope.kv6 myself- what needs to change?

I am thinking of slightly remodeling the FAL as well to take advantage of the halved size, and I have some new sounds for it which are epic :)- do you want to co-release? Green_BigSmile
Chameleon
Modder
Modder
Posts: 601
Joined: Thu Nov 22, 2012 6:41 pm


Scope.kv6 has random voxels either missing or sticking out and is not symmetrical (both horizontally and vertically). I mean, you can have range and windage adjusters sticking out the sides, but the scope body itself should be symmetrical. What I meant with replacing the scope is making it have those diagonal voxels you see on AK sights, which would mean I'd have to work on a new scope model. (edit: which I've already done 100% - you'll only need to add some details)

I do accept to co-release.

EDIT: While the gun seems to be halfway finished, I came across bugs that are hard to explain. Etc if I change the position of right hand, lefthand dissappears (or moves somewhere), so I removed righthand when reloading for now.

EDIT_2:I made the scope, the scope itself is 100% aligned (don't use flaslight!)
FN FAL 2014.10.17 release - Dropbox

EDIT_3: I did almost everything. Except the right hand. I couldn't stop it poking trough the model while reloading, had to cut it off. It's like you have a ghost doctor that follows you everywhere, cutting off your right hand and sewing it back on every time you reload. Blue_Happy3
FN FAL 2014.10.18 release - Dropbox
Oh and a couple of screens:
Spoiler:
ImageImage
Pedroh
Post Demon
Post Demon
Posts: 1174
Joined: Fri Jul 19, 2013 8:19 pm


you deserve an award
Chameleon
Modder
Modder
Posts: 601
Joined: Thu Nov 22, 2012 6:41 pm


Thanks! But it's not really for awards/badges (they are nice tho), I just do what I like :)
Can I haz THIS Green_Cookie as a badge of honor?
Pedroh
Post Demon
Post Demon
Posts: 1174
Joined: Fri Jul 19, 2013 8:19 pm


You may have a dozen of them
142 posts Page 3 of 10 First unread post
Return to “OpenSpades MODs”

Who is online

Users browsing this forum: No registered users and 10 guests