DORDER_RTR

For AI and campaign script related discussions and questions
Post Reply
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

DORDER_RTR

Post by aubergine »

Can this be used on VTOLs, or only land droids?

What happens if the order is issued on a transporter? (same question goes for DORDER_REARM)

EDIT: Also, what is difference between DORDER_RTR and DORDER_REPAIR?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: DORDER_RTR

Post by aubergine »

And what is difference between DORDER_RTB and DORDER_RETREAT?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: DORDER_RTR

Post by Per »

Not sure what happens if RTR is used on VTOL. Probably nothing intended. DORDER_REPAIR is used to make a repair droid repair some other droid. RTR is used to make a droid go back to base to repair. DORDER_RETREAT is used to go back to a predefined retreat point, currently only used in campaign.
User avatar
Artofeel
Greenhorn
Posts: 7
Joined: 10 Feb 2012, 15:32
Location: Russia
Contact:

Re: DORDER_RTR

Post by Artofeel »

Per wrote:DORDER_REPAIR is used to make a repair droid repair some other droid.
Really? Not DORDER_DROIDREPAIR ?
DORDER_REPAIR it doesn't repair the buildings?
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: DORDER_RTR

Post by aubergine »

@Artofeel: Correct, DORDER_REPAIR makes a droid repair buildings, not other droids. However I'm not sure if there is some foo in the WZ source that transparently maps DORDER_REPAIR to DORDER_DROIDREPAIR if DORDER_REPAIR is applied to a droid?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: DORDER_RTR

Post by aubergine »

From order.cpp line 1592:

Code: Select all

	case DORDER_RETREAT:
	case DORDER_RUNBURN:
	case DORDER_RUN:
		psDroid->order = *psOrder;
		if (psOrder->type != DORDER_RUN || psOrder->pos == Vector2i(0, 0))
		{
			psDroid->order.pos = asRunData[psDroid->player].sPos;
		}
		if (psDroid->order.pos == Vector2i(0, 0))
		{
			// We have still not managed to find a valid place to run.
			objTrace(psDroid->id, "Wants to run, but has no designated retreat point - standing still.");
			break;
		}
		actionDroid(psDroid, DACTION_MOVE, psDroid->order.pos.x, psDroid->order.pos.y);
		break;
Anyone know what asRunData is (or more specifically what defines the .sPos property for a given player)?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: DORDER_RTR

Post by Per »

Hmm, seems I failed to see some senseless distinction between DORDER_REPAIR and DORDER_DROIDREPAIR. Will try to look into that more closely later.

asRunData is (another senseless) global that keeps track of where droids should run when they are issued a run order or fail a morale test. What? A morale test? This is another special hack that only applies to special campaign situations (and that should have been implemented in campaign scripts, not hardcoded in the c++ source). Oh, and it is consistently spelled wrong, so if you search for "morale" you won't find any hits. Try 'moral'.
Cyp
Evitcani
Evitcani
Posts: 784
Joined: 17 Jan 2010, 23:35

Re: DORDER_RTR

Post by Cyp »

Not 'moral' test? It's not an ethics test, then?
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: DORDER_RTR

Post by aubergine »

Is sPos the player starting position?

DORDER_RTR_SPECIFIED might be another pointless one to look at - surely we could just use DORDER_RTR with orderDroidObj()?

And speaking of Moral(e) is that something to do with DACTION_SULK?

BTW, if any of the DORDERs or DACTIONs change, is there some way to get notified?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: DORDER_RTR

Post by Per »

.sPos is the run-to position.

DACTION_SULK is a hack for working around obstacles.

You will sometimes get an idle notification when a droid goes from some order to none, but not yet consistent. Nothing else yet.
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: DORDER_RTR

Post by aubergine »

Per wrote:You will sometimes get an idle notification when a droid goes from some order to none, but not yet consistent. Nothing else yet.
Sorry, I was unclear in my message above. I was referring to changes in the source code - eg. when Warzone itself gets changed. Specifically I'd like some way of keeping track of things so that I can keep my unofficial JS API docs up-to-date - they are getting somewhat extensive now:

https://warzone.atlassian.net/wiki/disp ... i/Contents
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Post Reply