Transforming scenery object

Various development-related discussions
Post Reply
User avatar
whoosh
Noob
Posts: 23
Joined: Fri Aug 12, 2022 7:38 am
Has thanked: 1 time
Been thanked: 2 times

Transforming scenery object

Post by whoosh »

Hey, I'm working on the temple of ikov quest.

I'm at the part where you attach the lever handle (id 83) to the lever bracket (id 86).

I cannot "use" the lever handle on the bracket, it does nothing (my character does not move) and I receive no dialogue saying that there's an unhandled interaction or so.

Also, I'm wondering when I figure out the point above, how I would transform the lever bracket into a complete lever.
User avatar
Ceikry
Site Admin
Posts: 585
Joined: Wed Aug 10, 2022 11:48 pm
Location: Draynor Village
Has thanked: 82 times
Been thanked: 103 times

Re: Transforming scenery object

Post by Ceikry »

whoosh wrote: Sat Sep 03, 2022 2:11 pm Hey, I'm working on the temple of ikov quest.

I'm at the part where you attach the lever handle (id 83) to the lever bracket (id 86).

I cannot "use" the lever handle on the bracket, it does nothing (my character does not move) and I receive no dialogue saying that there's an unhandled interaction or so.
Have you created code to handle such an interaction? If so, post it.
whoosh wrote: Also, I'm wondering when I figure out the point above, how I would transform the lever bracket into a complete lever.
This is one of the things Varbits are for, read up about all of that here.
Nerds
User avatar
whoosh
Noob
Posts: 23
Joined: Fri Aug 12, 2022 7:38 am
Has thanked: 1 time
Been thanked: 2 times

Re: Transforming scenery object

Post by whoosh »

I'm not sure what code I need to add for this, I added a listener like so:

Code: Select all

        on(Scenery.LEVER_BRACKET_86, SCENERY, "use") { player, bracket ->
            println("Using lever on bracket...")
            
            // Check that I have the lever handle and do something to make this a complete lever
            
            return@on true
        }
User avatar
Ceikry
Site Admin
Posts: 585
Joined: Wed Aug 10, 2022 11:48 pm
Location: Draynor Village
Has thanked: 82 times
Been thanked: 103 times

Re: Transforming scenery object

Post by Ceikry »

whoosh wrote: Sat Sep 03, 2022 2:19 pm I'm not sure what code I need to add for this, I added a listener like so:

Code: Select all

        on(Scenery.LEVER_BRACKET_86, SCENERY, "use") { player, bracket ->
            println("Using lever on bracket...")
            
            // Check that I have the lever handle and do something to make this a complete lever
            
            return@on true
        }

Code: Select all

	onUseWith(SCENERY, Items.LEVER_WHATEVER, Scenery.LEVER_BRACKET_86) {player, bracket ->
		/** code **/
	}
Use with interactions are fundamentally a different type of interaction and are handled differently.
Nerds
User avatar
whoosh
Noob
Posts: 23
Joined: Fri Aug 12, 2022 7:38 am
Has thanked: 1 time
Been thanked: 2 times

Re: Transforming scenery object

Post by whoosh »

Oh boy.. I read my code after I posted it and waited for this lol
User avatar
whoosh
Noob
Posts: 23
Joined: Fri Aug 12, 2022 7:38 am
Has thanked: 1 time
Been thanked: 2 times

Re: Transforming scenery object

Post by whoosh »

Yeah same problem, it doesn't say I have an unhandled interaction, there's just no interaction:

https://cdn.discordapp.com/attachments/ ... backet.mov
User avatar
aweinstock
Developer
Posts: 31
Joined: Thu Aug 11, 2022 1:17 am
Been thanked: 14 times

Re: Transforming scenery object

Post by aweinstock »

Scenery objects that have an examine but no left-click options incorrectly didn't get loaded into the map server-side (so they appear as null for use-item-with-scenery interactions when choosing which handler to dispatch to). That's fixed in !758, so rebase onto 24d42a4c70c6bff18d4d192a982a7956707f1680 until that's merged.
User avatar
aweinstock
Developer
Posts: 31
Joined: Thu Aug 11, 2022 1:17 am
Been thanked: 14 times

Re: Transforming scenery object

Post by aweinstock »

Ceikry wrote: Sat Sep 03, 2022 2:17 pm
whoosh wrote: Also, I'm wondering when I figure out the point above, how I would transform the lever bracket into a complete lever.
This is one of the things Varbits are for, read up about all of that here.
"Lever bracket" 86 and "Lever" 87 don't seem to have varps or varbits associated with them, nor is there a wrapper object that contains them.

Code: Select all

86: SceneryDefinition { name: "Lever bracket", models: [2092], configuration: [4], interactable: Some(1) }
87: SceneryDefinition { name: "Lever", models: [2108], configuration: [4], interactable: Some(1), options: [Some("Pull"), None, None, None, None] }
User avatar
Ceikry
Site Admin
Posts: 585
Joined: Wed Aug 10, 2022 11:48 pm
Location: Draynor Village
Has thanked: 82 times
Been thanked: 103 times

Re: Transforming scenery object

Post by Ceikry »

aweinstock wrote: Sat Sep 03, 2022 3:21 pm
Ceikry wrote: Sat Sep 03, 2022 2:17 pm
whoosh wrote: Also, I'm wondering when I figure out the point above, how I would transform the lever bracket into a complete lever.
This is one of the things Varbits are for, read up about all of that here.
"Lever bracket" 86 and "Lever" 87 don't seem to have varps or varbits associated with them, nor is there a wrapper object that contains them.

Code: Select all

86: SceneryDefinition { name: "Lever bracket", models: [2092], configuration: [4], interactable: Some(1) }
87: SceneryDefinition { name: "Lever", models: [2108], configuration: [4], interactable: Some(1), options: [Some("Pull"), None, None, None, None] }
yup, already been acknowledged. Some of this discussion leaked into the discord because he pinged me with a video.
Nerds
Post Reply