Duude92 / hammertime

An open source alternative to Valve's Hammer Editor for the Goldsource engine. Fork of the Sledge hammer project.
https://logicandtrick.github.io/sledge/
BSD 3-Clause "New" or "Revised" License
14 stars 2 forks source link

[FEATURE REQUEST] Origin editing #19

Closed Qwertyus3D closed 5 months ago

Qwertyus3D commented 5 months ago

Simple, as it sounds. Add the editable "Origin" field for entities (Property name / Value in "Object properties" window). Currently it's not possible to view/edit it manualy, though it's a basic parameter of any entity.

Duude92 commented 5 months ago

Are you confused by Source Engine? Hammertime currently doesn't support Source Engine modifications, nor Source FGD file structure. For GoldSrc: compilers decides where origin is - by placing solid brush with 'origin' texture groupped with entity. If you modding some GoldSrc game, that requires their own map compilers - then they probably should provide right FGD, that contain Object Origin field.

Qwertyus3D commented 5 months ago

I want to edit a position of point entities on map manually, by value (GoldSrc). If you open a saved map file, you see origin for any entity, like this:

{
"classname" "weapon_9mmhandgun"
"delay" "0"
"angles" "0 0 0"
"target" "gun_mm"
"origin" "1709.65 3349.94 80.0647"
}

So origin I'm talking about is not a compiler related thing and not about any special mod. FGDs normally don't have origin field. And I have no idea how to add it. And why if map editor could just show this field by default, at least in Smart Edit mode.

Duude92 commented 5 months ago

It's basically point-entity location in 3D space. You can move entity with 2D view, to be more precise - with keyboard arrow keys by 1 unity, and holding Ctrl - by 0.25 unit I've added couple changes to display it with SmartEdit property. With DumbEdit it wont change any settings. Need to be tested more with latest-origin-editing-feature

Qwertyus3D commented 5 months ago

Thanks, it works. But has problems with Undo/Redo. Doesn't show changes. Also sometimes edited object just disappers (probably can be caused by editing more than 1 value at once).

Duude92 commented 5 months ago

Updated code, now it supports undo/redo actions. Need more information about second issue - can't reproduce it rn.

Duude92 commented 5 months ago

What about this feature, does issue with disappearing object stil remains?

Qwertyus3D commented 5 months ago

I downloaded latest build, it doesn't have Origin feature at all. Shoud I revert to previous build to test?

Duude92 commented 5 months ago

To test function - download from latest-origin-editing-feature release, since that feature could cause new bugs - I wont merge feature branch into development one

Qwertyus3D commented 5 months ago

Seems to be working as intended, at least see no conflicts with anything.