Fishing

Got some instructions on how to add this and that to MS4? Go ahead and post.
Forum rules
Make sure your tutorials are kept up to date with the latest MS4 releases.

Re: Fishing

Postby Nean » Sat Apr 11, 2009 4:22 pm

So I would use a loop?
Image
GIAKEN wrote:Since I'm into men, not women

GIAKEN wrote:I can't take these huge penises anymore! All that's left is shame! And blood
User avatar
Nean
Persistant Poster
 
Posts: 704
Joined: Thu Jul 24, 2008 6:42 am
Google Talk: infectiousbyte@gmail.com

Re: Fishing

Postby Matt » Sat Apr 11, 2009 5:38 pm

Nean wrote:So I would use a loop?


No, that's what this does:

Code: Select all
If GetPlayerInvItemNum(Index, GetPlayerEquipmentSlot(Index, Weapon)) = FishRod Then
Matt
 

Re: Fishing

Postby Nean » Sat Apr 11, 2009 5:43 pm

Matt wrote:
Nean wrote:So I would use a loop?


No, that's what this does:

Code: Select all
If GetPlayerInvItemNum(Index, GetPlayerEquipmentSlot(Index, Weapon)) = FishRod Then


Well that's all good and whatnot, however when I try to attack on a fish tile, without the fishing tool, it gives me a packet error (Packet Modification), and then it just says that I have lost my connection with MIrage Source. But when I just have it [code] If GetPlayerEquipMentSlot(index, Weapon) = FishRod Then [code], it works fine. Maybe there's something wrong with the GetPlayerInvItemNum function.
Image
GIAKEN wrote:Since I'm into men, not women

GIAKEN wrote:I can't take these huge penises anymore! All that's left is shame! And blood
User avatar
Nean
Persistant Poster
 
Posts: 704
Joined: Thu Jul 24, 2008 6:42 am
Google Talk: infectiousbyte@gmail.com

Re: Fishing

Postby Matt » Sat Apr 11, 2009 7:09 pm

Nean wrote:
Matt wrote:
Nean wrote:So I would use a loop?


No, that's what this does:

Code: Select all
If GetPlayerInvItemNum(Index, GetPlayerEquipmentSlot(Index, Weapon)) = FishRod Then


Well that's all good and whatnot, however when I try to attack on a fish tile, without the fishing tool, it gives me a packet error (Packet Modification), and then it just says that I have lost my connection with MIrage Source. But when I just have it [code] If GetPlayerEquipMentSlot(index, Weapon) = FishRod Then [code], it works fine. Maybe there's something wrong with the GetPlayerInvItemNum function.


The problem is, when you equip the fishing rod, it fills the weapon's slot. So basically, you equip the rod as a weapon. Which is fine. Good idea, imo anyways. Now, when you use your check, you're just getting the slot in the inventory that your weapon is in.

So, if you have your fishing rod as item number 200 and you have it in your inventory as item number 2, it'll never work. It would need to be in inventory slot 200 to work. See what I mean? By changing it to what I posted, you're checking the actual weapon's item number against the rod's item number, not the inventory slot it's in.

Hopefully that explains it a bit better. Lol.
Matt
 

Re: Fishing

Postby Nean » Sat Apr 11, 2009 10:11 pm

Matt wrote:
Nean wrote:
Matt wrote:
Nean wrote:So I would use a loop?


No, that's what this does:

Code: Select all
If GetPlayerInvItemNum(Index, GetPlayerEquipmentSlot(Index, Weapon)) = FishRod Then


Well that's all good and whatnot, however when I try to attack on a fish tile, without the fishing tool, it gives me a packet error (Packet Modification), and then it just says that I have lost my connection with MIrage Source. But when I just have it [code] If GetPlayerEquipMentSlot(index, Weapon) = FishRod Then [code], it works fine. Maybe there's something wrong with the GetPlayerInvItemNum function.


The problem is, when you equip the fishing rod, it fills the weapon's slot. So basically, you equip the rod as a weapon. Which is fine. Good idea, imo anyways. Now, when you use your check, you're just getting the slot in the inventory that your weapon is in.

So, if you have your fishing rod as item number 200 and you have it in your inventory as item number 2, it'll never work. It would need to be in inventory slot 200 to work. See what I mean? By changing it to what I posted, you're checking the actual weapon's item number against the rod's item number, not the inventory slot it's in.

Hopefully that explains it a bit better. Lol.


Oh, okay I get it. Thanks for the explanation. Any ideas on how to fix this then? I'm pretty clueless ,I don't see why it's causing packet errors.
Image
GIAKEN wrote:Since I'm into men, not women

GIAKEN wrote:I can't take these huge penises anymore! All that's left is shame! And blood
User avatar
Nean
Persistant Poster
 
Posts: 704
Joined: Thu Jul 24, 2008 6:42 am
Google Talk: infectiousbyte@gmail.com

Re: Fishing

Postby Labmonkey » Sat Apr 11, 2009 10:22 pm

I assume you are getting "hacking attempt, packet modification" errors. (I am too lazy to look at the other page). I was getting those too recently. It is caused when there is an error in the game from something run from inside the handledata sub (and all subs it calls, and all subs they call, etc). Turn off the error checking and you should see your error.
GIAKEN wrote:I think what I see is this happening:

Labmonkey gets mod, everybody loves him, people find out his code sucks, he gets demoted, then banned, then he makes an engine called Chaos Engine.
User avatar
Labmonkey
Pro
 
Posts: 547
Joined: Sun Aug 05, 2007 2:26 pm

Re: Fishing

Postby Jared » Mon Apr 13, 2009 3:20 am

Entire project search cannot find

Code: Select all
' Used for map key open editor
Public KeyOpenEditorX As Long

Public KeyOpenEditorY As Long




using labmonkeys Latest MS4 version.

:ps: everything else was found. except that.
User avatar
Jared
Regular
 
Posts: 50
Joined: Tue Jun 03, 2008 6:22 pm

Re: Fishing

Postby Nean » Mon Apr 13, 2009 4:17 am

Don't mind that, it was taken out. just throw the code up at the top of ModGameEditors, I think it is.
Image
GIAKEN wrote:Since I'm into men, not women

GIAKEN wrote:I can't take these huge penises anymore! All that's left is shame! And blood
User avatar
Nean
Persistant Poster
 
Posts: 704
Joined: Thu Jul 24, 2008 6:42 am
Google Talk: infectiousbyte@gmail.com

Re: Fishing

Postby Tony » Mon Apr 13, 2009 4:25 am

Nean wrote:
Matt wrote:
Nean wrote:
Matt wrote:
Nean wrote:So I would use a loop?


No, that's what this does:

Code: Select all
If GetPlayerInvItemNum(Index, GetPlayerEquipmentSlot(Index, Weapon)) = FishRod Then


Well that's all good and whatnot, however when I try to attack on a fish tile, without the fishing tool, it gives me a packet error (Packet Modification), and then it just says that I have lost my connection with MIrage Source. But when I just have it [code] If GetPlayerEquipMentSlot(index, Weapon) = FishRod Then [code], it works fine. Maybe there's something wrong with the GetPlayerInvItemNum function.


The problem is, when you equip the fishing rod, it fills the weapon's slot. So basically, you equip the rod as a weapon. Which is fine. Good idea, imo anyways. Now, when you use your check, you're just getting the slot in the inventory that your weapon is in.

So, if you have your fishing rod as item number 200 and you have it in your inventory as item number 2, it'll never work. It would need to be in inventory slot 200 to work. See what I mean? By changing it to what I posted, you're checking the actual weapon's item number against the rod's item number, not the inventory slot it's in.

Hopefully that explains it a bit better. Lol.


Oh, okay I get it. Thanks for the explanation. Any ideas on how to fix this then? I'm pretty clueless ,I don't see why it's causing packet errors.
Image
User avatar
Tony
Persistant Poster
 
Posts: 860
Joined: Wed Nov 29, 2006 11:25 pm
Location: Ayer

Re: Fishing

Postby Hyperion » Fri Jun 19, 2009 7:21 pm

Well Helloooo There :P

Okay Quick Problem I've run into...
I've put everything in, but now when I click on the opt in the mapeditor and I go to place it it gives me

I've finished the tutorial now.. And I place the fishing attribute down on the map (Is it not supposed to show up like a block ... Eg: Block as a B. Does Fishing have an F?)
Anyways It just gave my Server a Runtime Error 9 when I hit ctrl on the spot

It Specifically highlights this
Code: Select all
Public Function GetPlayerInvItemNum(ByVal Index As Long, ByVal InvSlot As Long) As Long
    GetPlayerInvItemNum = Player(Index).Char(TempPlayer(Index).CharNum).Inv(InvSlot).Num
End Function
User avatar
Hyperion
Newbie
 
Posts: 5
Joined: Thu Jun 18, 2009 3:50 pm

Re: Fishing

Postby deathknight » Sat Jun 20, 2009 2:15 am

First, check your version of MS. This may not work with a different version if they've changes a few things.

Second, are you sure you are copying it correctly? This bit of code Client Side makes it show up on the map as a blue F.

Code: Select all
                       Case TILE_TYPE_FISHING
                            DrawText TexthDC, ((X * PIC_X) - 4) + (PIC_X * 0.5), ((Y * PIC_Y) - 7) + (PIC_Y * 0.5), "F", QBColor(Blue)
deathknight
Regular
 
Posts: 60
Joined: Wed Jan 16, 2008 8:50 pm

Re: Fishing

Postby Matt » Sat Jun 20, 2009 12:51 pm

InvSlot prolly equals 0.
Matt
 

Re: Fishing

Postby Hyperion » Sat Jun 20, 2009 6:56 pm

deathknight wrote:First, check your version of MS. This may not work with a different version if they've changes a few things.

Second, are you sure you are copying it correctly? This bit of code Client Side makes it show up on the map as a blue F.

Code: Select all
                       Case TILE_TYPE_FISHING
                            DrawText TexthDC, ((X * PIC_X) - 4) + (PIC_X * 0.5), ((Y * PIC_Y) - 7) + (PIC_Y * 0.5), "F", QBColor(Blue)


Yeah I fixed that part already and it started showing up and

Matt wrote:InvSlot prolly equals 0.


What do you suggest I do to fix this?

I feel bad for asking so many questions >.< :P
User avatar
Hyperion
Newbie
 
Posts: 5
Joined: Thu Jun 18, 2009 3:50 pm

Re: Fishing

Postby Matt » Sat Jun 20, 2009 8:53 pm

Hyperion wrote:
deathknight wrote:First, check your version of MS. This may not work with a different version if they've changes a few things.

Second, are you sure you are copying it correctly? This bit of code Client Side makes it show up on the map as a blue F.

Code: Select all
                       Case TILE_TYPE_FISHING
                            DrawText TexthDC, ((X * PIC_X) - 4) + (PIC_X * 0.5), ((Y * PIC_Y) - 7) + (PIC_Y * 0.5), "F", QBColor(Blue)


Yeah I fixed that part already and it started showing up and

Matt wrote:InvSlot prolly equals 0.


What do you suggest I do to fix this?

I feel bad for asking so many questions >.< :P


Don't feel bad. First thing, you have to find the line that is passing the wrong number. Then you have to look at the code that gets you the inv slot. Something with it needs tweaked.
Matt
 

Re: Fishing

Postby Hyperion » Sun Jun 21, 2009 2:55 am

I've searched through some of the code and from what I can tell and what you've told me is that its getting bugged because the Invslot is equalling Zero when its looking for a number? Specifically the number of the fishing rod? If so the only line that would have to do with info about the fishing rod would be

Code: Select all
 'Make sure they have the fishing rod.
    If GetPlayerInvItemNum(Index, GetPlayerEquipmentSlot(Index, Weapon)) = FishRod Then


Am I on the right track here or pulling nothing from no where :P
User avatar
Hyperion
Newbie
 
Posts: 5
Joined: Thu Jun 18, 2009 3:50 pm

Re: Fishing

Postby Solodev » Fri Aug 14, 2009 1:02 am

the form download form the first post is not available any more. can any one else host it?
Solodev
Newbie
 
Posts: 23
Joined: Fri Aug 07, 2009 4:49 pm

Re: Fishing

Postby Nean » Sun Sep 09, 2018 6:25 am

Really want, to thank everyone, for help with commas., 11 years later and I think I get it
Image
GIAKEN wrote:Since I'm into men, not women

GIAKEN wrote:I can't take these huge penises anymore! All that's left is shame! And blood
User avatar
Nean
Persistant Poster
 
Posts: 704
Joined: Thu Jul 24, 2008 6:42 am
Google Talk: infectiousbyte@gmail.com

Previous

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest

cron