Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fishing
#76
Nean Wrote:
Matt Wrote:
Nean Wrote:So I would use a loop?

No, that's what this does:

Code:
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.
Reply
#77
Matt Wrote:
Nean Wrote:
Matt Wrote:
Nean Wrote:So I would use a loop?

No, that's what this does:

Code:
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.
Reply
#78
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.
Reply
#79
Entire project search cannot find

Code:
' 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.
Reply
#80
Don't mind that, it was taken out. just throw the code up at the top of ModGameEditors, I think it is.
Reply
#81
Nean Wrote:
Matt Wrote:
Nean Wrote:
Matt Wrote:
Nean Wrote:So I would use a loop?

No, that's what this does:

Code:
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.
Reply
#82
Well Helloooo There Tongue

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:
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
Reply
#83
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:
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)
Reply
#84
InvSlot prolly equals 0.
Reply
#85
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:
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 >.< Tongue
Reply
#86
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:
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 >.< Tongue

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.
Reply
#87
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:
'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 Tongue
Reply
#88
the form download form the first post is not available any more. can any one else host it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)