• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Wurst] Rects and Regions in Wurst

Status
Not open for further replies.
Level 11
Joined
Sep 14, 2009
Messages
284
I want to create a way to register any units that enters the map without having to use actual Regions created in the WE. But wurst only accepts regions, not rects, for the "registerEnterRegion()".
Anyone have an idea how to solve this?

Code:
package DamageDetectionSystem

public trigger DDS = null

init
    DDS = CreateTrigger()
        ..registerEnterRegion(GetWorldBounds(), null)
 
Level 23
Joined
Jan 1, 2009
Messages
1,617
Level 23
Joined
Jan 1, 2009
Messages
1,617
Not sure I understand where to use this. Autocomplete doesnt find any OnUnitEnterLeave after the .. for CreateTrigger()

Open the package, the API is right at the top. Something like
Wurst:
onEnter() ->
   getEnterLeaveUnit().doSomething()

And I prefer to create my own systems. Im just translating my own dds from vjass to wurst.

The DamageDetection inside the stdlib isn't a system, it's a framework to build your system with/around. It's like 60 lines and just does what you are doing (unit enter/leave + damage event registration) and wraps it in a neat

Wurst:
addOnDamageFunc() ->
    print("Damage Event with dmg: " + GetEventDamage().toString())

The PR was just fyi in case you had something like that in mind.

Also, ctrl+p ony shows my own wurst files in the project

Should not be the case if you created your project with a recent setup version. The crucial option is "search.useIgnoreFiles": false because the _build folder is in .gitignore.
I just verified that it works with a demo project created by setup:
PisoA9Y.png


We sadly are lacking overall documentation for the stdlib - the packages usually provide their own, so feel free to look inside them.
 
Last edited:
Status
Not open for further replies.
Top