Access direction of the cursor stack

Place to get help with not working mods / modding interface.
Post Reply
ridcully
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sun Jul 05, 2015 7:11 pm
Contact:

Access direction of the cursor stack

Post by ridcully »

Is there a way to get the current direction of the `cursor_stack`? I want get hold of the direction of the item the player holds in hand. The player has a method to turn the item, but it looks like the direction is not accessible via API? Am I wrong? TIA!

User avatar
Adil
Filter Inserter
Filter Inserter
Posts: 945
Joined: Fri Aug 15, 2014 8:36 pm
Contact:

Re: Access direction of the cursor stack

Post by Adil »

Nope. Cursor stack doesn't have "direction" property in it, it hasn't any connection to the transparent green\red ghost that indicates the possibility of placement. The direction of entity you're building is connected to hardcoded mechanics of the item placement.
You can detect only the orientation of entity when it is built and the on_built_entity event is raised.
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.

User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: Access direction of the cursor stack

Post by aubergine18 »

You can also, from vague memory, programatically change rotation of an entity when placed - see the Concrete Lamppost mod for example. (I could be completely wrong about this, just remember seeing something about rotation in that mod but haven't fully investigated what it does yet, or why).
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.

ridcully
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sun Jul 05, 2015 7:11 pm
Contact:

Re: Access direction of the cursor stack

Post by ridcully »

Is this information available in v15?

User avatar
mickael9
Fast Inserter
Fast Inserter
Posts: 112
Joined: Mon Mar 14, 2016 4:04 am
Contact:

Re: Access direction of the cursor stack

Post by mickael9 »

Unfortunately, no.

See my request here: viewtopic.php?f=28&t=45815

Post Reply

Return to “Modding help”