Page 1 of 1

just some help for os modders - .as files

Posted: Thu Jun 19, 2014 1:59 pm
by Chameleon
ill just leave this here - Rifle rear sight drawing parameters explained a bit (View.as)
whatever

Matrix4 sightMat = weapMatrix;
//idk
sightMat *= CreateTranslateMatrix(0.025f, -7.f, -4.5f);
// CreateTranslateMatrix("left/right_coordinate".f, "distancefromeye_coordinate".f, "up/down_coordinate".f)
// More explanation: Basically you'll only need the middle value, which changes how far the model is from eye //(more=far). it can even have negative values.
sightMat *= CreateScaleMatrix(0.05f);
// determines size scale. "Weapon.kv6" seen in 3rd person has scale = 1.0f,
//"WeaponNoMagazine.kv6" seen in 1st person has scale = 0.5f
// this rear sight has scale = 0.05f, that means it is 10 times smaller than 1st person gun
//AND 20 times smaller than 3rd person gun.
// meaning that:
// CreateScaleMatrix(0.5f) and CreateScaleMatrix(0.05f) will have 1:10 cubes.
// CreateScaleMatrix(0.5f) and CreateScaleMatrix(0.025f) will have 1:20 cubes.
// CreateScaleMatrix(0.5f) and CreateScaleMatrix(0.02f) will have 1:25 cubes.
// CreateScaleMatrix(1.f) and CreateScaleMatrix(0.5f) will have 1:2 cubes.
// NOTE: do not forget any dots (1.f etc.), even if there are no numbers after the dot.
// NOTE: 1:20 and more doesn't look beautiful anymore, the sides of cubes start flickering. Stay simple!
param.matrix = sightMat;
//idk
renderer.AddModel(sightModel1, param);
//renders model

Re: just some help for os modders - .as files

Posted: Thu Jun 19, 2014 3:55 pm
by MaxShadow
I was going to make a little .as tutorial, but I'm too lazy :B There isn't much to do there anyway, the offset can be done in Slab6 with pivots. However, you can only resize through script. There are more things you can do if you understand well the functions and the language itself, like changing animations and adding more attachments and sounds.

Re: just some help for os modders - .as files

Posted: Thu Jun 19, 2014 4:06 pm
by bloodfox
I did not understand a word you said. (Maybe it is because I am too lazy...)

Re: just some help for os modders - .as files

Posted: Wed Jul 02, 2014 7:35 pm
by Chameleon
Well I know about pivots, but you see, pivots can get messed up a lot, and there is limit on pivot value (i think), while .as file gives almost infinite (float variable size) freedom. For attachments, I did something that moves when you reload
http://buildandshoot.com/posting.php?mo ... 57&t=11609

Re: just some help for os modders - .as files

Posted: Thu Jul 03, 2014 3:14 am
by dotting103
GJ Chameleon