Page 1 of 1

Need help to script cooking

Posted: 13 Jul 2010, 12:33
by EatMyShrapnel
Hi,
I try to make (my first script) a script which should do that :
gui_angle_calculation.lua :

Code: Select all

1) until Build command is activated
2) If the building to build is "MyHouse"
then
2.1.1) Draw a line from the center of "MyHouse" to my mouse world (x,z)[color=#FF0000]*[/color] position
2.1.2) AngleCalculationVariable = angle calculation
else
2.2.1 ) do nothing
end if
* y is the height, right ?

MyHouse.bos

Code: Select all

create()
{
1) LocalAngle = AngleCalculationVariable
2) Rotate My house of LocalAngle
etc.
}
etc.
I failed to draw my line and I don't know how to share a value between a gui_script and a function from bos file. there is a doxygen doc somewhere ? I look in the wiki but I dont found all informations.

Re: Need help to script cooking

Posted: 13 Jul 2010, 17:20
by AF
The relevant APIs are under the umbrella titled cob 2 lua, but keep in mind that cob does not natively support floating point type numbers, whereas lua does, so you may have issues depending on what calculations are done in cob.

An alternative you may consider is using a lua animation script instead of a COB/Bos script