Forum Discussion

linux249's avatar
6 years ago

Script/API: Reserve Spot

Hi,

I builded an external service which "remember" the scanned Layouts and I want to add the information if the layout is already reserved ingame.

Is there a api for getting all "Reserved Spots" marker inside "your" alliance via script? Optimally with names of players and coordinates? If not, do you have some suggestions which api would do this job best?
The way my script scans all coords/layouts is the slowest/worst way to do this stuff XD

And is there a way to "hook" the "set/remove marker" functionality with own functions so my script can update the "state" immediately?

Regards,
Linux249
  • Hi,

    You can use
    ClientLib.Data.MainData.GetInstance().get_Alliance().get_Markers().l.get_CoordX()

    ClientLib.Data.MainData.GetInstance().get_Alliance().get_Markers().l is the array of markers of your alliance

    And then on each marker you can use these functions
    get_CoordX: ƒ ()
    get_CoordY: ƒ ()
    get_DateCreated: ƒ ()
    get_DateEdited: ƒ ()
    get_Description: ƒ ()
    get_Id: ƒ ()
    get_IdPlayerCreated: ƒ ()
    get_IdPlayerEdited: ƒ ()
    get_NamePlayerCreated: ƒ ()
    get_NamePlayerEdited: ƒ ()
    get_Type: ƒ ()

    You can hook the set/remove marker, but it's harder, you need to insert code in function without breaking the game using new Function("a", "b", newcode);

    You have 3 functions that are used to edit, create or delete markers, it's the easier to hook for you since you don't have to deal with generated names and you just have to insert your own code at the beggining of each function.
    ClientLib.Data.MainData.GetInstance().get_Alliance().CreateMarker(bi, bf, be, bd);
    ClientLib.Data.MainData.GetInstance().get_Alliance().DeleteMarker(bj, bi);
    ClientLib.Data.MainData.GetInstance().get_Alliance().EditMarker(bj, bi, bf, be, bd);


    But again it's not easy to do

About Tiberium Alliances Technical Issues

Having problems running the game or a script? Get help with Command and Conquer: Tiberium Alliances with the community!

1,439 PostsLatest Activity: 2 hours ago