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

Added global lua function CreateInvalidObject (#652) #666

Merged
merged 1 commit into from
Oct 1, 2024
Merged

Added global lua function CreateInvalidObject (#652) #666

merged 1 commit into from
Oct 1, 2024

Conversation

igromanru
Copy link
Contributor

@igromanru igromanru commented Sep 27, 2024

Resolves #652

Testing
Built UE4SS and deployed in Abiotic Factor.
Tested with Lua code:

local blankObject = CreateBlankObject()
print("blankObject varibale type: " .. type(blankObject))
if blankObject then
	print("blankObject userdata type: " .. blankObject:type())
	print("blankObject IsValid:" .. tostring(blankObject:IsValid()))
end

Result:

[12:40:32.1231285] [Lua] blankObject varibale type: userdata
[12:40:32.1231360] [Lua] blankObject userdata type: UObject
[12:40:32.1231428] [Lua] blankObject IsValid:false

Additional
Fixed FindFirstOf return type annotation in Types.lua

Documentation
All changes documented in Changelog.md and created a new docs page for CreateBlankObject.

assets/Changelog.md Outdated Show resolved Hide resolved
@igromanru
Copy link
Contributor Author

igromanru commented Sep 28, 2024

Can someone just Clone the branch from my fork, compile and test it locally, then just force merge?
Also please squash commits while merging.

UE4SS
UE4SS previously approved these changes Sep 28, 2024
@narknon
Copy link
Collaborator

narknon commented Sep 30, 2024

I think "Blank" is a bit confusing. Maybe dummy or empty?

@UE4SS
Copy link
Collaborator

UE4SS commented Sep 30, 2024

I think "Blank" is a bit confusing. Maybe dummy or empty?

Perhaps "CreateInvalidObject" is even more accurate to what the function actually does ?

@narknon
Copy link
Collaborator

narknon commented Sep 30, 2024

I guess CreateInvalidLuaUObject is too verbose

@UE4SS
Copy link
Collaborator

UE4SS commented Sep 30, 2024

I guess CreateInvalidLuaUObject is too verbose

Yeah I don't think "LuaU" is necessary, and besides, we might reuse this function at some point for non-UObject stuff so it's nice to keep the "U" out of "Object".
It really doesn't have anything to do with UObject anyway, it's just a function implemented for UObjects among other objects.

@narknon
Copy link
Collaborator

narknon commented Sep 30, 2024

Yeah. I guess CreateInvalidObject works.

@igromanru
Copy link
Contributor Author

Tested;

local invalidObject = CreateInvalidObject()
print("blankObject variable type: " .. type(invalidObject))
if invalidObject then
	print("blankObject userdata type: " .. invalidObject:type())
	print("blankObject IsValid: " .. tostring(invalidObject:IsValid()))
end

Result:

blankObject variable type: userdata
blankObject userdata type: UObject
blankObject IsValid: false

@igromanru igromanru changed the title Added global lua function CreateBlankObject (#652) Added global lua function CreateInvalidObject (#652) Sep 30, 2024
…valid UObject (#652)

docs: Add CreateInvalidObject function to Types.lua (#652)
docs: Fix return value of FindFirstOf, it's just UObject, never nil
docs: Add CreateInvalidObject documentation page
docs: Modify Changelog.md for current changes
@UE4SS UE4SS merged commit 229040b into UE4SS-RE:main Oct 1, 2024
2 of 3 checks passed
@igromanru igromanru deleted the issue_652 branch October 2, 2024 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants