Right Click Context Menu on Weapons?

Axebeardbeardaxe
Scavenger
Posts: 6
Joined: 17 Jan 2016, 18:20

Right Click Context Menu on Weapons?

Postby Axebeardbeardaxe » 10 Feb 2017, 14:11

I saw that items can have context menus now, but wasn't able to find out much info from digging through the files.
I added this to my test weapon and it didn't seem to work:
use4_functor = spare_parts.ak
use4_action_functor = spare_parts.give_spare_parts
use4_text = "Disassemble"

The goal is to be able to disassemble weapons for different types of parts. I'm very new to scripting with CoC and could use some help, or an example script to look at. This was my feeble attempt to get something to happen:

Code: Select all

function ak(itm)
       if (ak = true) then
              return game.translate_string("ak_parts")
       end
end

function give_spare_parts(itm)
   SetHudMsg("You dismantle the weapon",5)
end

User avatar
Alundaio
S.T.A.L.K.E.R.
Posts: 1371
Joined: 26 May 2012, 22:26

Re: Right Click Context Menu on Weapons?

Postby Alundaio » 11 Feb 2017, 03:57

syntax error (ak = true)
You use == operator for comparisons and = to set a variable. But that is not what you want to do.


Code: Select all

function ak(itm)
         return game.translate_string("ak_parts")
end

function give_spare_parts(itm)
   SetHudMsg("You dismantle the weapon",5)
end


Try that and build from there.
"I have a dream that one day this community will rise up and live out the true meaning of its creed: "We hold these truths to be self-evident; that all mods are created equal."


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest