What to use for scripting?
What to use for scripting? Map.ActorsInBox or Trigger.OnEnteredFootprint?
What to use for scripting?
I want to have a square bounty arround an oil field and I want it to play a play a one time PlaySpeechNotification when a unit enters. What to use? Map.ActorsInBox or Trigger.OnEnteredFootprint? Both seem like they can work just fine.
Re: What to use for scripting?
I play here in Dune 2000 only (sometimes). So don't quite understand your problem.
I use both functions Map.ActorsInBox and Trigger.OnEnteredFootprint succefully in my mods. If your need just working example, then I can right it down.
I use both functions Map.ActorsInBox and Trigger.OnEnteredFootprint succefully in my mods. If your need just working example, then I can right it down.
Re: What to use for scripting?
Example of Map.ActorsInBox
We can repair units of tech but we cannot do the same for human units.
So I made place for hospital. Healing place (I call it “lechebnica”) .
First (and only one) actor, who comes to the square gets MaxHealth.
We can repair units of tech but we cannot do the same for human units.
So I made place for hospital. Healing place (I call it “lechebnica”) .
Code: Select all
-- place for hospital (mesto pod lechebnicu),
-- where variable “verh” is left-top of square
-- and variable “niz” is right-bottom.
verh = WPos.New(91*1024, 79*1024, 0)
niz = WPos.New(93*1024, 81*1024, 0)
Tick = function()
-- lechebnica ---------------------
pacient = Utils.Where(
Map.ActorsInBox (verh, niz),
function(actor) return actor.Type == "light_inf"
or actor.Type == "trooper"
or actor.Type == "sardaukar"
or actor.Type == "engineer"
or actor.Type == "fremen"
and actor.Owner == player
end)
if (#pacient>0) then
pacient[1].Health = pacient[1].MaxHealth
end
-- ---------------------
Re: What to use for scripting?
Ah thank you I misunderstood what Map.ActorsInBox did it returns actors and doesn't act like a trigger, so I should use Trigger.OnEnteredFootprint. You saved me a lot of time!