OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Flauta on 04 Apr 2005, 22:24:27
-
well actuali I was working in a Script.. not really for ofpr... jjeeje just to do more Easly mi Matts Homework...
i it is about all the Sin Cos Tan thing.. but in in a special case I have a rare error!! not really sure wy this happen... maybe I have a Grammar mistake.. or mi Matts arent really good...
well this is the script wich has a rarely malfuction...
;tarea de MAtematicas "sohCahToa.sqs"
;NOTE Change the X for a 0
;And the _line must be Adyasent to the Angle
;it still Beta....
;use like this: [Catet,Hipotenusa,Angle] exec "sohcahtoa.sqs"
Hint "Executing..."
_arr = count _this
? _arr == 3 : goto "SohCahToa"
? _arr == 4 : goto "inverse"
? _arr <= 1 : hint "Error 001: Parametros mal definidos"; exit
? _arr > 4 : hint "Error 002: Demasiados Parametros"; exit
#SohCahToa
_Hip = _this select 0
_linea =_this select 1
_angulo1 =_this select 2
? _hip == 0 : Goto "toa"
? _linea == 0 : Goto "SohCah"
hint "Error 003: Algo esta mal definido"
exit
#toa
hint "Cargados: 3 Elementos (SohCahToa)\n Calculando Hipotenusa"
~1
[b];Problem starts here[/b]
_ncos = cos _angulo1
_rcos = _linea / _rcos
_ntan = tg _angulo1
_rtan = _ntan * _linea
hintC format ["Operacion Realizada:(Angulo %1)\nCateto Adyasente:%2\nCateto Opuesto %3\nHipotenusa %4\n\nTan:%4 Cos:%6",_angulo1,_linea,_rtan,_rcos,_ntan,_ncos]
[b];Problem ends here[/b]
Exit
#sohCah
hint "Cargados: 3 Elementos (SohCahToa)\n Calculando Catetos"
~1
_ncos = cos _angulo1
_ncos2 = sin _angulo1
_rcos = _ncos * _Hip
_rcos2 = _ncos2 * _Hip
hintC format ["Operacion Realizada:(Angulo %1)\nCateto Adyasente:%2\nCateto Opuesto:%3\nHipotenusa %4\n\nCos: %5 Sen: %6",_angulo1,_rcos,_rcos2,_Hip,_ncos,_ncos2]
Exit
#inverse
hint "Cargados: 4 Elementos (Asen Acos Atan)\nEn Construccion"
exit
and the problem is when_linea = 0
is in Spanish.. but I dont think this will be aproblem
-
Hey Flauta,
Do you get an error message? If you do, please post it.
The only possible problem I see is this:
_rcos = _linea / _rcos
You are saying _rcos is equal to _linea divided by _rcos.
_rcos is not defined anywhere else, so you are dividing _linea by an undefined variable. This might be causing a problem.
-
well, that whas an little writing error... but the problem sill's there, the Hipotenuse take the same number of the Tan one... did U tried the script?
-
No, I haven't tried it yet.
-
Hey Flauta,
I think I have found another problem, this time in this line:
hintC format ["Operacion Realizada:(Angulo %1)\nCateto Adyasente:%2\nCateto Opuesto %3\nHipotenusa %4\n\nTan:%4 Cos:%6",_angulo1,_linea,_rtan,_rcos,_ntan,_ncos]
You have this:
Hipotenusa %4And this:
Tan:%4
In your hint, you are assigning the hypotenuse and tangent the same value, change the line to this:
hintC format ["Operacion Realizada:(Angulo %1)\nCateto Adyasente:%2\nCateto Opuesto %3\nHipotenusa %4\n\nTan:%5 Cos:%6",_angulo1,_linea,_rtan,_rcos,_ntan,_ncos]
-
jojo Great!!!! pilot thanks 4 your time!!!!, that was wholle problem.. just writing problems.. I must write more carefully! I cant belive that it was the problem!
thanks alot!
Flauta
Note: I Think the problem is solved.. but I cant test it yet... I'll solve it when I be sure
Keep Commenting!!! and someone else! poor Pilot!