Question: How to align scope in OS

OpenSpades is an open source alternative client for AoS Classic and beyond! Runs on Windows, Mac, and Linux. Created by yvt.
Compatible with AoS Classic.
2 posts Page 1 of 1 First unread post
ShadowRanger787
Modder
Modder
Posts: 191
Joined: Mon Dec 10, 2012 11:25 pm


Here's the question for all you OS script wizards out there, how do I realign the line of sight so I can use my scope. I have the scope where I want it, I just need to move where your dude is looking so it lines up with the scope. When I look through in 1st person the line of sight is too low and I can't look through the sight. Any ideas on which lines of code I have to modify to fix this? Blue_Tongue
Thanks,
Shadow
Chameleon
Modder
Modder
Posts: 601
Joined: Thu Nov 22, 2012 6:41 pm


Mkay...
I am currently using TOpenSpadongs by topo. One of the features it has it's that the crosshair stays even when you zoom in. I think that this is the line of code you need for this:
void Draw2D() {
BasicViewWeapon::Draw2D();
}
Why do you need crosshair? So you know your sight is aligned.

Next thing I am going to do is explain some parameters of models in View.as file.

These are lines for rear sight on SMG. (They are ~six months old and might have changed in last OpenSpades releases.)
sightMat = weapMatrix;
//you should look up weapMatrix some day, but now it is not really neccessary,
//it just tells that sightMat is a gun part.
//you can try commenting out this line.
//Though when you sprint it will not show animation on this particular model,
//because it will no longer be recognised as a weapon part.
//
sightMat *= CreateTranslateMatrix(0.025f, -5.f, -4.9f);
//you need to edit this line. " *= " means that sightMat variable will be influenced by CreateTranslateMatrix variable.
//If you use " = " instead, sightMat will have CreateTranslateMatrix value, but it will lose any other values it had (Scale etc.).
//CreateTranslateMatrix tells the game where model is positioned, like x,y,z.
//(x,y,z) (x+left/-right, y+further/-closer, z+down/-up).
//Meaning that numbers like CreateTranslateMatrix(1.f, 2.0f, 3.5f) will make the model go: 1 to left, 2 to further and 3,5 down.
//Having a zero/anynumber after period"." isn't neccessary, but having ".f" IS A MUST and game WILL NOT START without these.
//sometimes numbers will be negative - that is completely normal, just give them some chocolate and tell them you care.
//
sightMat *= CreateScaleMatrix(0.1f);
//This scales the model. Current 0.1 scale means 10:1 block.
param.matrix = sightMat;
renderer.AddModel(sightModel2, param);
//renderer then draws sightModel2, using param parameters.

I did a bit more info than you need, but it will be good for you later on :)
Check out these sweet animations for SMG:
http://buildandshoot.com/viewtopic.php?f=57&t=11609
2 posts Page 1 of 1 First unread post
Return to “OpenSpades Discussion”

Who is online

Users browsing this forum: No registered users and 19 guests