Programatically making the player interact with objects

Ive been poking around in the source code for a few days now, and have been able to understand most of whats happening. But I’ve hit a wall with programatically getting the player to interact with objects.

Specifically, i am trying to get my character to take the log balance at the gnome agility course using a .rs2 file, called by a dev command. The object is gnome_log_balance, with a reference # of 2295

I THINK this log balance normally works by linking the log balance script to a specific tile, so that when the tile is clicked, the log balance oploc1 script runs. (Something like oploc1, gnome_log_balance)

Is there a way to trigger oploc1 functions without clicking on the tile?

I imagine its possible in a similar way to how the king bolren script moves the player using p_walk()

This is all written on my phone at work. When i get home later, I’ll add specific code references to make this clearer and more understandable

Exact tile doesn’t matter :slight_smile: when the server receives the oploc packet from the client it validates everything then sets your character’s interaction.

Programmatically - set the active loc pointer to the log and p_oploc(1); will set the interaction to the first op.

You’ll have to loc_find to set the pointer and may want to walk the player to a specific tile first, or it’ll just do the nearest approach it can with no control over the path taken.

You need to fire this off from some kind of trigger through, a timer / queue / debugproc for testing purposes!

2 Likes

You da real mvp. This is getting me back into coding.