Help with set_location()

When I click sea locations in mafia's GUI, it alters the droprate based on the pressure modifier for that location. I'd like to use that functionality in a script.

A little checking of the wiki led me to the function set_location() which sounds exactly what I want.

But when I set_location, it only selects the general zone in the GUI, not the specific location. Also the item drop modifiers and meat drop modifiers aren't affected.
> ash set_location($location["Noob Cave"]); print(my_location()+" "+item_drop_modifier())

Noob Cave 140.78505426185217
Returned: void

> ash set_location($location["The Dive Bar"]); print(my_location()+" "+item_drop_modifier())

The Dive Bar 140.78505426185217
Returned: void

Should I make a bug report for this, or am I doing it wrong?
 
I think you need to add numeric_modifier("Item Drop Penalty") to your calculations.

I think item_drop_modifier() should return the modified value including the location. In any event:

> ash set_location($location["noob cave"]); print(numeric_modifier("Item Drop Penalty"))

0.0
Returned: void

> ash set_location($location["the dive bar"]); print(numeric_modifier("Item Drop Penalty"))

0.0
Returned: void
 

Bale

Minion
Okay... This is weird. darkcodelagsniper is exactly correct.

> ash set_location($location[the dive bar])

Returned: void

> ash my_location()

Returned: The Dive Bar
nocombats => false
zone => The Sea
parent => The Sea
parentdesc => The Sea
bounty => none

> ash item_drop_modifier()

Returned: 50.0

> ash numeric_modifier("Item Drop Penalty")

Returned: 0.0

> ash item_drop_modifier()

Returned: -150.0

> ash numeric_modifier("Item Drop Penalty")

Returned: -200.0

The difference between the first and second is that I highlighted "The Dive Bar" on the Adventuring Tab. I actually had to manipulate the UI to make this work. I think we have a problem here.


Should I make a bug report for this, or am I doing it wrong?

You should make that bug report.
 
Last edited:

AlbinoRhino

Active member
Hmmm, yes, I should have looked up item_drop_modifier(). Maybe "Adventure Underwater" needs to be true before the penalty gets returned ? Or was it true when you did that ?
 

Bale

Minion
Nope. No underwater adventuring possible for me or my Eggman companion. All I did was select "The Dive Bar" from the list of locations on the adventuring tab.
 

AlbinoRhino

Active member
Yeah ... I was guessing, while you were actually trying it. Also, your post wasn't there when I started my post.
 
Top