What's new
Roleplay UK

Join the UK's biggest roleplay community on FiveM and experience endless new roleplay opportunities!

Fishing

Josh_MGD

Member
Location
South West
Ok, i've done a lot of the jobs with good sucess but fishing from a boat is problematic.  I can swim and catch all the fish i want, but from the boat - nothing not even a tiddler!  Here's what i do;

1. Get in boat and get to a likely area.

2. Stop boat check scroll menu for 'Drop Nets' and action as required

3. Wait a minute or two and nothing

4. Drive around at slow speed - still nothing

So my questions are;

1. Does the fishing function work?

2. If so what am i doing wrong?

I have checked the AL script fn_dropFishingNet.sqf and i conclude you shouldnt have to wait to long to get a 'nibble'!!

 
Try using some fresh bait fresh rozzer meat works best the fishes love zee bacon taste. :)

 
The only way I've successfully managed to "catch" fish is to shoot them with the SDAR.

I was convinced the "drop nets" interaction was broken somehow. (This was a while ago, maybe they fixed it)

 
   I was convinced the "drop nets" interaction was broken somehow.
I have a version of Altis Life (original - US Style) and in that i think the references are wrong for the files.  Do you know where i can get this version so i can check the scripts?

 
Ok - using the US version and i drop the nets after a few seconds there is an error reported to do with the inventory function  (fn_handleInv.sqf)  I missed the line number though!!  So i assume this is broken and it bails out which leaves the variable life_net_dropped  at false so you cant drop another net until restart.

Can someone look into this and get it working?  In the meantime i'll look into it and try to find a solution.

Line 22 of the file and the error is:

_value=missionNamespace   |#|getVariable _var;

if(_math)

..blah blah

Error getvariable: Type Bool, expected Array,String

 
Last edited by a moderator:
You can actually grab live fish with windows key while swimming an SDAR is only required to kill and harvest turtles.

 
After having a sneaky looksie at the code myself, it seems to only work when you're actually near a fish, not just dropping the nets willy nilly. I'm no scripter so I don't know for certain, but it looks like it should work on paper.

This should also apply to dead turtles, which seems a little obsolete to be honest.

fn_handleInv.sqf is the script that adds items to your inventory, maybe it's throwing an error because it's trying to add a fishy that you haven't actually caught? I haven't seen that error when I tried it myself, then again I did only try maybe a dozen attempts.

If it is a proximity to the fish when you drop the net I may try later in a sub so I know for certain I'm actually close.

 
Sovereign/Jay many thanks for the replies.  I had been swimming after the fish and catching as described.

Anyway - Think i've cracked it!! 

I believe there is a call to the stringable.xml file which returns the fish name but capitialised (eg Tuna not tuna).  In the varhandling script it returns true rather than the life_name (in my example "life_inv_tuna") because it asks for 'Tuna' not 'tuna'.

Can someone have a look at the coding also - just in case i'm barking up th wrong tree!!

I will re pbo the files after changing the stringable and get back with results later tonight.

 
Last edited by a moderator:
I think I've found it... but as yet untested (I may get a chance to fix this for the 8pm build, but I'll probably run a test on the dev-server first if I get time this afternoon).

I think what's happening is this:

In 'fn_catchFish.sqf' (the underwater 'grab' action for fish), the current cursor-target object is checked for 'fishyness' and a range less than 3.5m. If a match, it then does a 'switch do' (which is rather like a BASIC 'select case') on the type of fishy object, checking its ARMA3 object-typename. If it matches a known ARMA3 fish-object, it sets the _type variable to one of 'salema', 'mackerel', 'ornate' and so on. Note that these are ALL entirely lower-case words. The 'fn_handeInv.sqf' is then called to add that item type to the player's inventory.

Conversely, in the 'fn_dropFishingNet.sqf' version of the process (which is essentially the same, but has a 20m range, and requires some set up to do with boat speed, crew, etc, before the net is droppable) the switch-do to find the 'fish-object' type is slightly different. In this version, the _type variable is set up to use a LOCALISED version of a string that's stored in stringtable.xml. The fish-type strings here are NOT the same.. they use types like 'Salema', 'Mackerel', 'Ornate', etc. Notice that first capital letter?

Once again, the resulting _type variable is thrown at the fn_HandleInv.sqf function as before...

...so let's look at what happens in there...

First thing (of any consequence) that it does there, is call another function 'fn_varHandle.sqf' to convert the '_type' variable that we were given by fn_catchFish or fn_dropFishingNet into a variable known to Altis Life (one of the 'missionspace' variables'). These missionspace variablenames are like 'life_inv_salema', 'life_inv_mackerel', 'life_inv_ornate' and so on, and usually contain a number that shows how many of a given object is held by the player. VarHandle uses another 'switch/do' to check the input _var (_type) and return the output as 'life_inv_whatever'... but it EXPECTS the input _var to be LOWERCASE entirely.

Consequently, it will fall over when _var is given as the string "Salema" instead of "salema". Switch-do is CASE-SENSITIVE (according to this note on here, at least: https://community.bistudio.com/wiki/switch_do). Thus, "Salema" would drop all the way through, and instead of returning a string saying "life_inv_salema", would instead return a Boolean 'FALSE' value back to fn_HandleInv.sqf (the calling script).

fn_HandleInv.sqf would then fail on line 22, because it's expecting _var (from the fn_varHandle.sqf function above) to be a STRING which names a player's life_inv_xxxx variable, but instead, all it has is a Boolean false, due to the broken exit from that function. Hence the error - it expected a string, but got given a Boolean (true/false), and died on its arse.

Net result (pardon the pun)... no fish for you!

Easily resolveable, though. We either make the localised strings all lower case in stringtable.xml, or we adjust the fn_varHandle.sqf switch-do so that it copes with BOTH variations of the string (capitalised and lower-case throughout), and exits the routine cleanly with the right 'life_inv_xxxx' string/variablename.

TBH, looking through the rest of the codebase, the ONLY place where a 'localised' version of the fish-type is ever used, is in fn_dropFishingNet.sqf! It never actually appears on screen as a result of the stringtable.xml variables, and the stringtable.xml version serves NO other purpose than (intendedly) making fn_dropFishingNet.sqf work. Which it doesn't. So - by far the easiest fix is to just make the fish typenames all lower-case in the stringtable.xml; they'll never been seen anyway, and nothing else needs to be changed.

Thanks for the puzzle. That's another one of Tonic's dropped balls picked up and put in the back of the net! :)

 
Last edited by a moderator:
Duh... answers crossed in the post... Seems we all reached the same conclusion at the same time!

Recomping the PBO won't do you much good - it'll be overwritten immediately you rejoin the server, because that's what the server does (it might work in 'single-player' mode, though, but a lot else will fail, obviously - the mission may not even load, tbh).

Anyway.... This will be in the 8pm build now, so it *should* work in future. Happy fishing! :)

 
Yup i can confirm the capitialisation cocks it up - also Cat Shark has to be one word - catshark.

Recomping the PBO won't do you much good - it'll be overwritten immediately you rejoin the server, because that's what the server does (it might work in 'single-player' mode, though, but a lot else will fail, obviously - the mission may not even load, tbh).
I meant on my home Server which is where i've successfully tested it.

On a slightly different note there was mention of lobsters etc in the requests for features.  I don't mind doing testing or even a bit of scripting if help is required.

 
Actually, 'Cat Shark' in the STRINGTABLE.XML would've failed for a SECOND reason as well... it has a space in it! The end code would actually be expecting 'catshark' in order to work. This is now fixed too.

Sadly, I noticed that the STRINGTABLE.XML variable for 'Rabbit' (now set to rabbit, just in case), is NEVER accessed anywhere else in the code at all. I've just butchered the 'CatchFish' script very slightly, so that it is now possible to catch rabbits, too! They should appear in your inventory as 'Rabbit Meat', just like the kind you can buy in shops, and you should be able to eat, sell or give them away just as normal. In theory, if you can catch the live rabbit, it's yours to eat. Pretty sure it'll also work if you shoot the rabbit and try to pick it up... Haven't tested that yet.

See what happens when we report bugs? We get to make easter eggs too. I love this job. :)

 
Duh... Again with the crossing in the post! LOL. (Catshark/Cat Shark).

 
Is the lobster an existing 'stock' ARMA3 object-type? If it is, and it's encounterable in the game-world without anything needing to be done, it should be possible to add it as a catchable entity.

 
Sadly, I noticed that the STRINGTABLE.XML variable for 'Rabbit' (now set to rabbit, just in case), is NEVER accessed anywhere else in the code at all. I've just butchered the 'CatchFish' script very slightly, so that it is now possible to catch rabbits, too! They should appear in your inventory as 'Rabbit Meat', just like the kind you can buy in shops, and you should be able to eat, sell or give them away just as normal. In theory, if you can catch the live rabbit, it's yours to eat. Pretty sure it'll also work if you shoot the rabbit and try to pick it up... Haven't tested that yet.
Ho-ly-shit.

BRING ON 8PM.

Damn rabbits in BI games been pestering me long enough! Time for some revenge! What about snakes? Can we eat them soon too?

 
Shit, it's like Oliver Twist in here, isn't it? I give you wabbits, and you want fucking snakes.

TBH, I'm not sure about the snakes. At the moment there's certainly no Altis Life precedent in terms of a 'live_inv_snake' inventory item and that would take quite a bit of jiggling around to get in (and make sure that it didn't break anything).

Let's see if the Rabbit thing works (and the fish - but I'm confident that my tests will reveal what Josh has already checked locally - thanks btw).

I'm just running a test on our Development Server. Join me in TS now if you want the passwords and a chance to hunt wabbits before 8pm, and tell me if it works!

 
Back
Top