Need help to script cooking

Need help to script cooking

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
EatMyShrapnel
Posts: 31
Joined: 25 Jun 2010, 20:16

Need help to script cooking

Post 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.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Need help to script cooking

Post 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
Post Reply

Return to “Lua Scripts”