Bad idea. The game won’t accept this function in my own script.
I make this :
First, i need to know if the player built this fu***** teltak.
Second, if teltak is built, i place all ship on this aera or i use the Player_FillShipByType(“sg_teltak”,0, “goa_teltak”).
This part generate error. But the sobgroup is not empty (i force the game to check this before go other step). With my next step i would know if this sobgroup have one ship in the nebula. If this function return true, the pointer > Removed.
But, nothing happened.
So, i need to restart this part …
The full part :
function Rule_BuildTeltak()
if (Event_IsDone("BuildTeltak")) then
Rule_Add("StateBuildTeltak")
Rule_Remove("Rule_BuildTeltak")
end
end
function StateBuildTeltak()
SobGroup_Create("sg_teltak")
if (Stats_ShipsCreated( g_playerID , GetShipId("goa_teltak") ) == 1) then
-- Player_FillShipsByType("sg_teltak", 0, "goa_teltak" )
Player_FillSobGroupInVolume("sg_teltak", 0, "vol_player_0")
Rule_Add("BuildTEST")
Rule_Remove("StateBuildTeltak")
end
end
function BuildTEST()
if (SobGroup_Empty("sg_teltak") == 0) then
Objective_SetState( g_obj_build_teltak_id , OS_Complete)
print("Yo man, tu a build le bon vaisseau !")
Rule_Remove("BuildTEST")
Rule_Add("Rule_Coordinate")
Rule_Add("GetMoreRU")
end
end
function GetMoreRU()
if (Player_GetRU(0) >= 5500) then
Objective_SetState( g_obj_harvest_sec_id , OS_Complete)
Rule_Remove("GetMoreRU")
end
end
function Rule_Coordinate()
Event_Start("coordinate")
Rule_Add("AddingPointer")
Rule_Remove("Rule_Coordinate")
end
function AddingPointer()
tVol_1 = {5000, -10000, 10000}
Volume_AddSphere("vol_obj_coord", {tVol_1[1], tVol_1[2], tVol_1[3],}, 2500)
EventPointer_AddVolume("vol_obj_coord", HW2_rgb(230,0,0), 800)
Rule_Add("Check_DWhithPointer")
end
function Check_DWhithPointer()
if (SobGroup_AreAnySquadronsInsideNebula("sg_teltak", "Neb_coord") == 1) then
Objective_SetState( g_obj_send_teltak_id, OS_Complete )
print("On the Nebula.")
EventPointer_Remove("vol_obj_coord") -- remove the pointer - ok
Rule_Remove("Check_DWhithPointer")
Rule_AddInterval("Rule_END", 3)
end
end
Any idea ? Other ways possible ? (The player absolutely need to build this teltak ^^)