then I need to send a message to it from any random trigger, where I don't have ActorLastCreated() link. Also, I don't want to store the actor in variables. I want to access it by its point.
libNtve_gf_SendActorMessageToGameRegionWithFilters(RegionCircle(UnitGetPosition(EventUnit()),3.0),c_actorIntersectAgainstCenter,"Destroy","Text, CActorText","IsStatus text 1");
But nothing worked. The first one have sent the message to all actors, which were created by their units, but my triggerly created actor left alone. The second one did nothing, maybe I messed up with the filters.
So, how to send a message to n actor which has no connections with units?
As I said, I'd like to avoid using variables. I want to find a way to get a link to an actor with send-message-to-actor-in-region kind of function. This function can see any actors which were created automatically with their units, but it doesnt' see my actor created in a trigger. Maybe I nee to change the actor in data to make it visible for the actor-in-region functions?
Heh, completely missed the line, that you don't want to use variables. May I ask, why?
I didn't know, the actors would be ignored, when created via trigger; probably, because they are created in a null scope? You could try it the way the GAx3 mod does it: Create the actor at a specific invisible unit and use the "SetPosition" actor message to move it, where you need it, somewhat like this:
I think, region was correct. Because send-message function was able to destroy all other actors around the one I created. And now I can remove the attached actor with the same region. Maybe there was some kind of difference between visible coordinates and the coordinates send-message function checks. Maybe SetPosition2d message would solve it.
And yeah, I switched to attach the actor to a unit, because it's suitable for my situation. So I don't need to experiment more with create-actor-at-point case.
Thanx for help attempts. Think your GAx3 example would work too, but it loks a bit more complicated.
Do you mean complicated from a code organization standpoint? You could just put the stuff in a custom CreateActor/ModelAtPoint function and it would even look more organized without the libntve_ prefix ;)
Or do you mean from a performance standpoint? It would be hardly a difference, considering that the libNtve_gf_AttachActorToUnit function looks like this:
1. At least, I would need to spend time to understand what each command mean. Also, the code organization standpoint thing. I prefer to have 1 command instead of more.
2. Maybe it works for some actors, like the Model class ones, while I'm using the Text class actor, so, if you have time, just create a Text class actor, fill it with a text and replace the "Marine" actor in your test, and it won't be found by actor-in-region function.
(You actually use create-model function, which can't be used for text actor.)
btw, just tried to find my text actor with RegionEntireMap() region function - still can't be found.
You create text actors? Maybe Text Tags would be more suitable for this. They can fly, be attached etc
Yeah, I thought about text tags. But I asked myself: how am I'm going to remove 'em without variables. I have to create a text at select and remove it at unselect, so timered death won't help. Also, I don't need the text to fly. So, I decided to use text actor. And everything works great right now.
I've created an actor by this function:
then I need to send a message to it from any random trigger, where I don't have ActorLastCreated() link. Also, I don't want to store the actor in variables. I want to access it by its point.
I've tried this:
and this:
But nothing worked. The first one have sent the message to all actors, which were created by their units, but my triggerly created actor left alone. The second one did nothing, maybe I messed up with the filters.
So, how to send a message to n actor which has no connections with units?
€ this was wrong.
As I said, I'd like to avoid using variables. I want to find a way to get a link to an actor with send-message-to-actor-in-region kind of function. This function can see any actors which were created automatically with their units, but it doesnt' see my actor created in a trigger. Maybe I nee to change the actor in data to make it visible for the actor-in-region functions?
Heh, completely missed the line, that you don't want to use variables. May I ask, why?
I didn't know, the actors would be ignored, when created via trigger; probably, because they are created in a null scope? You could try it the way the GAx3 mod does it: Create the actor at a specific invisible unit and use the "SetPosition" actor message to move it, where you need it, somewhat like this:
Done from memory, so it might not be 100% accurate, but you get the idea.
To make everything as simple as possible. Map I work on is huge, so any additional variable, any tiny complementation may blow my mind :)
The create-actor-at-point/remove-actor-near-point looks the simpliest way for my aim: I want to visualize some info about units players select.
Just realized, that simple
makes the actor visible for actor-in-region function, so it totally solves my problem.
Thanx for help attempts. Think your GAx3 example would work too, but it loks a bit more complicated.
the libNtve_gf_SendActorMessageToGameRegion() works without issues. Make sure your region is correct.
EDIT:
This changes what you tried to do before. Static point actor vs attached to unit.
@Nerfpl: Go
I think, region was correct. Because send-message function was able to destroy all other actors around the one I created. And now I can remove the attached actor with the same region. Maybe there was some kind of difference between visible coordinates and the coordinates send-message function checks. Maybe SetPosition2d message would solve it.
And yeah, I switched to attach the actor to a unit, because it's suitable for my situation. So I don't need to experiment more with create-actor-at-point case.
Do you mean complicated from a code organization standpoint? You could just put the stuff in a custom CreateActor/ModelAtPoint function and it would even look more organized without the libntve_ prefix ;)
Or do you mean from a performance standpoint? It would be hardly a difference, considering that the libNtve_gf_AttachActorToUnit function looks like this:
Also, Nerfpl is right, the actor message affects a trigger-created actor. Tested it with this:
Marine gets created, is visible for 5 seconds, then gets destroyed.
@Kueken531: Go
1. At least, I would need to spend time to understand what each command mean. Also, the code organization standpoint thing. I prefer to have 1 command instead of more.
2. Maybe it works for some actors, like the Model class ones, while I'm using the Text class actor, so, if you have time, just create a Text class actor, fill it with a text and replace the "Marine" actor in your test, and it won't be found by actor-in-region function.
(You actually use create-model function, which can't be used for text actor.)
btw, just tried to find my text actor with RegionEntireMap() region function - still can't be found.
You create text actors? Maybe Text Tags would be more suitable for this. They can fly, be attached etc
Yeah, I thought about text tags. But I asked myself: how am I'm going to remove 'em without variables. I have to create a text at select and remove it at unselect, so timered death won't help. Also, I don't need the text to fly. So, I decided to use text actor. And everything works great right now.
True. Tho i would prefer text tags. More control from trigger level. Text Tags are integers. You could save it in unit's custom value for example.
But if it works for you than don't bother :)