Commit graph

26 commits

Author SHA1 Message Date
Kevin Eady
48c8a00476
Allow custom boat control script defined in boat item descriptor; Rename boat method setpilot to set_pilot (#591)
* Allow custom boat control script defined in boat item descriptor

* Rename boat.setpilot to boat.set_pilot
2024-01-08 18:46:01 +00:00
Kevin Eady
e5209a51ff
Add support for boat piloting via mouse movement (#558)
* Initial work on boat piloting changes
- Changed: Boat script is now registered as the boat's control script
- Added: Boat piloting via mouse movement
- Added: boatRef.pilot member
- Added: boatRef.pilot([charRef]) method

* add first test

* Fix boat control script attach on scripted create

* move boat move packet warnings to suspicious acts

* set pilot now errors when mutli has no process

* Add test, testclient support for boat move packet

* Touchup pilot members and methods
- Change `pilot` method to `setpilot`. This standarizes it a bit with
the same naming convention of `npc.setmaster`.
- Fix return values in `pilot` member, returning `0` if no pilot.

* Refactor to put functionality inside UBoat

* Address Discord comments
- Remove SuspecisionActs for no boat process.
- Add `relative_direction` to boat move sysevent.

* destroy boatmount on chr death; more error checks

* Fix compilation after master merge

* Fix relative_direction calculation

* wip tests

* Fix boat tests

* Address review comments
- Initialize UBoat::mountpiece

* Add HSA check to boat.setpilot

* Reject movement if boat mountpiece equipped

* docs; test cleanup

* add test for blocked movement

* Address Discord review comments
- Add suspicious acts notice for client movement while piloting
- Return error on attempting to script move a char that is piloting a boat

* Fix compiler warning
2024-01-06 18:01:31 +07:00
Peter Wedder
42f15b809f
Add new EScript function: GetStandingCoordinates, and a new option to GetStandingLayers (#476)
* Make GetStandingLayer recognize items & fix bug affecting the z-coordinates returned.

* Oblige oppressive line length requirements

* Don't need this workaround anymore

* Add includeitems parameter to GetStandingLayers.

* Add GetStandingCoordinates EScript function.

* Remove semicolon from documentation.

* Fix line length nags.

* Add "x", "y" members to documentation.

* Reformat code.

* Update corechanges.

* Fix line break in core changes.

* Remove dummy parameter by removing broken reinterpret_cast.

* Update GetStandingLayers documentation.

* Remove x,y parameter overload of get_walkheights.

* mf_GetStandingLayers: use Pos2d instead of x, y params.

* Remove x,y param overloads of readdynamics. Rename flagless version to read_walkable_dynamics.

* mf_GetStandingCoordinates: Refactor to use Core::Pos2d, Core::Range2d and Realms::Realm.

* Clarify GetStandingCoordinates documentation.

* Use correct error message in documentation.

* Fix function signature in uo.em

* Add test script for GetStandingCoordinates.

Adds a simple test script for GetStandingCoordinates which
compares the function's return value to known good data
from the test map.

* Update changelog

* Fix test

* Add a commented out block into test script to generate expected data

* Fix clearance check.

Walls and other tall shapes were not getting detected correctly.
2023-12-06 12:54:29 +01:00
Kevin Eady
8b7596659c
Add support to restart Item control scripts via RestartScript (#557)
* Add implementation

* Add tests

* Update modules, docs, core-changes

* Address review comments
- Use single `getUObjectParam` instead of both `getItem/CharParam`
2023-11-02 15:23:24 +01:00
turleypol
4895bfdf16
rewrite of FindPath (#554)
* rewrite of FindPath
added parameter for movemode, before it was only possible to use
findpath on land

* unknown movemode is now an explicit error.
extended tests
docu

* added core changes

* typo
2023-10-23 19:35:40 +02:00
Kevin Eady
d9fd8d4590
Fix DestroyItem() crash when passing a multi (#506) 2023-02-28 16:26:25 +01:00
Kevin Eady
1b879bc59f
Add script helpers to implement stealing skill (#493)
* add item.character_owner

* Address review comments
- Cleanup chr_from_wornitems
- Return BError if no character owner

* Add Target option TGTOPT_ALLOW_NONLOCAL

* Address review comments
- Remove `Core::chr_from_wornitems`

* Add pol tests for snooping

* Add tests for TGTOPT_ALLOW_NONLOCAL

* target_nonlocal_checklos pol test debugging

* target_nonlocal_checklos pol test debugging
- Remove destroy of obstacle
- Add a CheckLosAt call to error return

* target_nonlocal_checklos pol test debugging
- Enable USAN build

* undo test debugging changes

* use mobile for los when targetting snoopable items

* Update core-changes

* Persist SnoopScript for items on save

* Add snoop_script_ to Item::estimatedSize

* document SnoopScript script type
2023-01-08 16:59:28 +01:00
Kevin Eady
ab151728d0
Add x, y parameters to create item function calls (#490) 2022-12-13 23:08:02 +01:00
che666
5bd51780d6
Update uo.em (#481)
* Update uo.em

* Fixes for Broadcast and BroadcastUC required_cmdlevel parameter

* updated changelog

* updated changelog
2022-10-24 13:30:42 +02:00
Peter Wedder
3ea8fc55ea
Add force parameter to CreateNPCFromTemplate() (#475)
* Add force parameter to CreateNPCFromTemplate()

* Update documentation

* Rename parameter to forcelocation

* Fix parameter name in docs

* Fix parameter name in docs (again)
2022-10-13 19:59:07 +02:00
turleypol
b1536d30a4
SendPopUpMenu update (#467)
* SendPopUpMenu supports now the newer format which removes the limitation
of the cliloc values

* fixed build errors

* revision increase when insurance gets reset on death.
added core changes

* updated online docs

* using enum for flag values
2022-08-14 11:35:38 +02:00
Kevin Eady
0f1199cae6
Fix bad XML from EnableEvents change (#379) 2021-02-28 14:59:04 +01:00
Fernando Rozenblit
ebaeab3dc8
Add option to receive only PC or NPC area events (#364)
* Add option to receive only PC or NPC area events: EnableEvents(ev, range, evmask)
where evmask can be:
0 -> accepts events from both PC or NPC (as it is now)
1 -> accepts events from PC only
2 -> accepts events from NPC only

* Add docs and entry in uo.em
* Add entered/leftarea tests
2021-02-27 23:46:21 +01:00
Kevin Eady
5bbc53ab6c
Add exit_code to uo::Shutdown() (#176)
* Add exit_code to uo::Shutdown()

Co-authored-by: Eric Swanson <eric.the.unicorn@gmail.com>
2020-08-03 20:30:27 +02:00
Jonathan Morland-Barrett
e66eac2b71
AddAmount returns ItemRef on success. (#114)
**BREAKING CHANGE**
Whilst the break may be minor for some its still worth checking if you evaluate the response from AddAmount anywhere in your scripts.
If you compare it to 1 (int) you need to update this as the function no longer returns an integer on success.
* Update AddAmount() function from uo.em to return the original itemref on a successful addition of amount.
2020-01-04 19:51:28 +08:00
GIB
76487f0ab2
SendQuestArrow() fix for HSA clients (#91)
* Changed SendQuestArrow to receive an arrow id rather than requiring an object reference.
*Added new error if no id is supplied to a cancellation request.
* .Fix uo.em to have correct default.
2019-06-19 10:30:41 +08:00
Admin\Me
c803057afe Fixed more documentation errors for the ListObjectsInBoxOfClass and ListItemsInBoxOfObjType functions. 2018-11-26 03:53:30 -06:00
Admin\Me
a9dbd4bf5b Fixed prototype in XML docs for ListObjectsInBoxOfClass and ListObjectsInBoxOfObjType 2018-11-26 01:13:06 -06:00
Admin\Me
34e22a2efc ** Fix docs for ListObjectsInBoxOfClass and remove commented debug code. 2018-11-26 01:04:56 -06:00
Admin\Me
13b55db32f **** Commit for 2018-11-25 ****
Added ListObjectsInBox to uo.em.
2018-11-25 21:54:52 -06:00
Admin\Me
edec78af5e **** Commit for 2018-11-25 ****
Added ListItemsInBoxOfObjType( objtype, x1, y1, z1, x2, y2, z2, realm := _DEFAULT_REALM) to uo.em
Updated core-changes.txt with the ListItemsInBoxOfObjType info.
Updated uo.em docs with the ListItemsInBoxOfObjType info.
2018-11-25 05:43:30 -06:00
GIB
8fb6f5ec54 Updated all files to include the FINDOBJTYPE_RECURSIVE default option. 2018-09-08 01:17:15 +08:00
GIB
771f2884d5 Changes to the way the flags were processed.
Removed references to non-inuse items.
Updated documentation.
Included new Racalac Guide documentation supplied by Yukiko.
Clangified my changes.
Updated change log.
2018-09-07 10:19:17 +08:00
GIB
e047e34ef2 List statics (#64)
Added new functions for getting statics with in a range that have certain restraints
2018-07-30 09:58:22 +02:00
Fernando Rozenblit
daf4e35150 Fixed Accessible(). It didn't take a range into account before. Check core-changes.txt for more information! 2018-02-11 14:59:20 +01:00
Gabriele Tozzi
88d7c84b6f Updating doc version to POL100 2018-02-11 00:01:46 +01:00
Renamed from docs/docs.polserver.com/pol099/uoem.xml (Browse further)