Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZScript interface to Trace() function #406

Merged
merged 3 commits into from Jan 21, 2018
Merged

Conversation

jewalky
Copy link
Contributor

@jewalky jewalky commented Jan 20, 2018

Some things that were sacrificed in the process of exporting:

  • actor flags filter (because actor flags work completely differently in ZScript)
  • line flags filter (it doesn't make a lot of sense to have line flags, but no actor flags (but this can be returned back))
  • fake/3D floor hit (because this structure is still not exported)

Added thing was HitTexture that now also works with walls, not just planes.
Callback function and results pointer were implemented as a virtual method + class field, as passing around structure and method pointers is not implemented properly.

Otherwise it's pretty complete reproduction of the original call.

Example code that uses it: https://hastebin.com/tefofehizu.cs
This example looks in player's view direction and returns the first relatively solid thing found. Doesn't try any advanced processing though.

@OrdinaryMagician
Copy link
Contributor

My LineTrace submission can be rejected if this one gets in.

@jewalky
Copy link
Contributor Author

jewalky commented Jan 20, 2018

Also, this is currently data-scope, since it's supposed to be purely informational.
By looking at the enums it seems calling Trace() can trigger stuff by simply tracing, so it might make sense to remove traceFlags or remove these flags if found. But here I'd need someone to tell me if it's true.

@coelckers
Copy link
Member

I still have to think about whether to only use this or both submissions. This one is a lot more heavy duty so it may be of value to have a simpler alternative at your disposal. Feedback is welcome.

@MajorCooke
Copy link
Contributor

I'd say having both would be nice. Modders can do more with more powerful stuff if they needed, or have a simpler alternative if they don't understand the bigger one.

@OrdinaryMagician
Copy link
Contributor

OrdinaryMagician commented Jan 20, 2018

Hmm, when you put it like that, it does make sense. I take back what I said then.

@coelckers coelckers merged commit ee1a8f7 into ZDoom:master Jan 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants