• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[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,610
Level 23
Joined
Jan 1, 2009
Messages
1,610
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