help about a gate

help about a gate

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

Moderator: Moderators

Post Reply
User avatar
daryl
Posts: 190
Joined: 08 Oct 2006, 10:33

help about a gate

Post by daryl » 23 Oct 2019, 18:46

hello all,
i have a small problem about this gate : in unitdef yard map="oo oo cc cc cc cc cc cc oo oo" so you can see in the picture tha passing is open but units can't pass trought the gate.
Where i wrong?
Attachments
gate.jpg
(51.35 KiB) Not downloaded yet
0 x

User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10228
Joined: 24 Jan 2006, 21:12

Re: help about a gate

Post by PicassoCT » 23 Oct 2019, 19:56

Did you set the unit yardstance, when turning it on and off?
0 x

User avatar
daryl
Posts: 190
Joined: 08 Oct 2006, 10:33

Re: help about a gate

Post by daryl » 23 Oct 2019, 21:56

in .cob script you mean?
i have this code:

Code: Select all

OpenYard()
{
	set YARD_OPEN to 1;
	while( !get YARD_OPEN )
	{
		sleep 1500;
		set YARD_OPEN to 1;
	}

}

CloseYard()
{
	set YARD_OPEN to 0;
	while( get YARD_OPEN )
	{

		sleep 1500;
		set YARD_OPEN to 0;
	}

}
0 x

DmitryProfessional
Posts: 15
Joined: 03 Jun 2019, 21:06

Re: help about a gate

Post by DmitryProfessional » 26 Oct 2019, 10:31

What's the size of a unit?
If the yard is "oo oo cc cc cc cc cc cc oo oo", it's either 1x20 or, most likely:
oooo
cccc
cccc
cccc
oooo
Which orientation doesn't make much sense. If it's a North gate, it should open/close to north, correct?
Use [[ ]] for things like yard instead of "", e.g.
[[o c c c o
o c c c o
o c c c o
o c c c o
o c c c o]]
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14589
Joined: 17 Nov 2005, 02:43

Re: help about a gate

Post by Forboding Angel » 28 Oct 2019, 11:33

If the yard is "oo oo cc cc cc cc cc cc oo oo", it's either 1x20
No. Top to bottom left to right punctuated by spaces.

"oo oo cc cc cc cc cc cc oo oo", is:
2 block, 2 block, 2 open, 2 open, 2 open, 2 open, 2 open, 2 open, 2 block, 2 block
0 x

User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10228
Joined: 24 Jan 2006, 21:12

Re: help about a gate

Post by PicassoCT » 28 Oct 2019, 12:30

creed wrote:With yards wide open under the sunlight
Welcome to this place I'll show you everything
With yards wide open now everything has changed
I'll show you love, I'll show you everything

With yards wide open
Wide open
0 x

User avatar
daryl
Posts: 190
Joined: 08 Oct 2006, 10:33

Re: help about a gate

Post by daryl » 28 Oct 2019, 21:04

Forboding Angel wrote:
28 Oct 2019, 11:33
If the yard is "oo oo cc cc cc cc cc cc oo oo", it's either 1x20
No. Top to bottom left to right punctuated by spaces.

"oo oo cc cc cc cc cc cc oo oo", is:
2 block, 2 block, 2 open, 2 open, 2 open, 2 open, 2 open, 2 open, 2 block, 2 block
and yardmap of gate is correct:
footprintx = 2,
footprintz = 10,
YardMap= "oo oo cc cc cc cc cc cc oo oo",
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14589
Joined: 17 Nov 2005, 02:43

Re: help about a gate

Post by Forboding Angel » 29 Oct 2019, 02:09

That's what I just said. Your example was incorrect, depicting a 4xX footprint, instead of the intended 2xX footprint.
0 x

User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6107
Joined: 29 Apr 2005, 01:14

Re: help about a gate

Post by FLOZi » 29 Oct 2019, 17:14

Is the intended orientation north/south opening or east/west?
0 x

User avatar
daryl
Posts: 190
Joined: 08 Oct 2006, 10:33

Re: help about a gate

Post by daryl » 29 Oct 2019, 20:18

FLOZi wrote:
29 Oct 2019, 17:14
Is the intended orientation north/south opening or east/west?
east/west
0 x

DmitryProfessional
Posts: 15
Joined: 03 Jun 2019, 21:06

Re: help about a gate

Post by DmitryProfessional » 29 Oct 2019, 21:32

How do u call Open/CloseYard? Should be from Activate/Deactivate callin.
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14589
Joined: 17 Nov 2005, 02:43

Re: help about a gate

Post by Forboding Angel » 30 Oct 2019, 03:48

So, from what I see in that screenshot, it appears that the yardmap is correct. The gateway is non-blocking it looks like. Perhaps without new orders the pathfinder isn't realizing that it can go through (Clutching at straws)?
0 x

User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6107
Joined: 29 Apr 2005, 01:14

Re: help about a gate

Post by FLOZi » 30 Oct 2019, 16:52

Derp, I totally missed the screenshot. Yeah yardmap is fine, and is open/closing ok too.

If I were you I'd use a lua unit script instead of cob and call Spring.SetUnitBlocking... MCL used to have gates and they worked that way;

https://github.com/SpringMCLegacy/Sprin ... s/Gate.lua
0 x

Post Reply

Return to “Lua Scripts”