ESOC UHC Plugin documentation & feedback

Technical Support for installation and running of the EP.
User avatar
Czech Republic EAGLEMUT
ESOC Dev Team
Donator 05
Posts: 4513
Joined: Mar 31, 2015
ESO: EAGLEMUT
Clan: WPact

ESOC UHC Plugin documentation & feedback

Post by EAGLEMUT »

The documentation has been moved onto wiki: https://wiki.eso-community.net/ESOC_UHC_Plugin

You may use this thread to report issues with ESOC UHC Plugin functionality or request new syscalls to be added.
User avatar
Great Britain Panmaster
Skirmisher
Posts: 166
Joined: Jan 1, 2016

Re: ESOC UHC Plugin documentation & feedback

Post by Panmaster »

1. xsArray functions don't work. (Crashes)
2. Malloc doesn't work either. (Crashes)
3. I can't get vectors to be initialized.


For starters you must add AI building repairs:

Code: Select all


//repair
void aiTaskUnitRepair(int unitID = -1)
{
   repairUnit(unitID);
}

//inside main
   UHCSyscall& saiTaskUnitRepair = pluginInfo->RegisterSyscall(GroupAI, SyscallVoid, "aiTaskUnitRepair", aiTaskUnitRepair, 1, "aiTaskUnitRepair: no help.");
   pluginInfo->SyscallSetParam(saiTaskUnitRepair, 0, SyscallInteger, &DefParamNum);
TAD AI Reference Guide
"Better to remain silent and be thought a fool than to speak out and remove all doubt." - Abraham Lincoln
User avatar
Czech Republic EAGLEMUT
ESOC Dev Team
Donator 05
Posts: 4513
Joined: Mar 31, 2015
ESO: EAGLEMUT
Clan: WPact

Re: ESOC UHC Plugin documentation & feedback

Post by EAGLEMUT »

@Panmaster repairUnit is already exported as aiRepairUnit.

I guess you'd have to consult UHC team themselves about the other things, since you're referring to issues in the C++ context. In ESOC UHC Plugin I successfully use regular C++ constructs instead of xsArray, so that is a possible workaround to some extent.

For vectors I think you must use them as input parameters, like in the example given by UHC team:
vector rmGetRandomLocationByDistance(vector result, vector center, float distance) {
float radians = rmRandFloat(0, 2 * 3.1415926F);

result->x = center->x + distance * cosf(radians);
result->y = center->y;
result->z = center->z + distance * sinf(radians);

// always return the first parameter (result vector)
return result;
}
No Flag kami_ryu
Retired Contributor
Posts: 2196
Joined: Jan 2, 2017

Re: ESOC UHC Plugin documentation & feedback

  • Quote

Post by kami_ryu »

I don't understand a damn thing going on in this thread.
User avatar
Bavaria Gichtenlord
Howdah
Donator 03
Posts: 1437
Joined: Nov 15, 2015

Re: ESOC UHC Plugin documentation & feedback

Post by Gichtenlord »

Big kiss to the one who can show me how to initialize an array or vector in xs
r]
User avatar
United States of America musketeer925
Retired Contributor
Donator 01
Posts: 2483
Joined: Mar 28, 2015
ESO: musketeer925

Re: ESOC UHC Plugin documentation & feedback

Post by musketeer925 »

Gichtenlord wrote:Big kiss to the one who can show me how to initialize an array or vector in xs



Code: Select all

int array_id = xsArrayCreateInt(length, default_value, "array_name"));
int array_id = xsArrayCreateFloat(length, default_value, "array_name"));
int array_id = xsArrayCreateString(length, "default_value", "array_name"));

xsArraySetString(array_id, index, "this is a string");
xsArrayGetString(array_id, index);
xsArrayGetSize(int array_id);


etc. I've used these in a trigger context on RE, they definitely work there. Not sure what @Panmaster is saying above about them not working or how he was using them -- perhaps UHC has broken them on EP? I doubt it though.

there are also Bool and Vector type arrays

vector creation, not sure if these work:

Image
User avatar
Czech Republic EAGLEMUT
ESOC Dev Team
Donator 05
Posts: 4513
Joined: Mar 31, 2015
ESO: EAGLEMUT
Clan: WPact

Re: ESOC UHC Plugin documentation & feedback

Post by EAGLEMUT »

Well, if UHC broke them on EP, the AI would literally not work at all, so I assume he is referring to the C++ side of things. Also malloc isn't a syscall at all, so yeah.

@Gichtenlord In XS you can initialize a vector like this:
vector mapOrigin = vector(0.0, 0.0, 0.0);

EZ
User avatar
Bavaria Gichtenlord
Howdah
Donator 03
Posts: 1437
Joined: Nov 15, 2015

Re: ESOC UHC Plugin documentation & feedback

Post by Gichtenlord »

Big kisses to both of you, @EAGLEMUT and @musketeer925
Im not into rms anymore, but it might be of use in the future :D
r]
User avatar
Great Britain Panmaster
Skirmisher
Posts: 166
Joined: Jan 1, 2016

Re: ESOC UHC Plugin documentation & feedback

Post by Panmaster »

I'd hoped there was something obviously wrong with the UHC array code. I guess not. It must be a deeper problem.

edit:
syscalls::_vector v = { 1.0f,1.0f,1.0f };

Does the repair function cost wood resources?
TAD AI Reference Guide
"Better to remain silent and be thought a fool than to speak out and remove all doubt." - Abraham Lincoln
User avatar
Czech Republic EAGLEMUT
ESOC Dev Team
Donator 05
Posts: 4513
Joined: Mar 31, 2015
ESO: EAGLEMUT
Clan: WPact

Re: ESOC UHC Plugin documentation & feedback

Post by EAGLEMUT »

I don't know, I just exported it in case it's useful for someone, didn't actually need it myself. Can you test it?
User avatar
Great Britain Panmaster
Skirmisher
Posts: 166
Joined: Jan 1, 2016

Re: ESOC UHC Plugin documentation & feedback

Post by Panmaster »

Yes. Repair does work the same as for human players, apart from the button being spammed until it got locked in.

edit: this works too
//set HC destination
void aiTaskUnitSetHC(int unitID = -1)
{
setHomeCityGatherUnit(unitID);
}
TAD AI Reference Guide
"Better to remain silent and be thought a fool than to speak out and remove all doubt." - Abraham Lincoln

Who is online

Users browsing this forum: No registered users and 2 guests

Which top 10 players do you wish to see listed?

All-time

Active last two weeks

Active last month

Supremacy

Treaty

Official

ESOC Patch

Treaty Patch

1v1 Elo

2v2 Elo

3v3 Elo

Power Rating

Which streams do you wish to see listed?

Twitch

Age of Empires III

Age of Empires IV