Aller au contenu

Photo

Check nothing equipped?


  • Veuillez vous connecter pour répondre
11 réponses à ce sujet

#1
K Kin

K Kin
  • Members
  • 109 messages

I have an island inhabited by monks who allow people with no weapons and armour on, including inventory.

It would be an incredible pain in the ass if I had to use the ga_equipped *not* / ga_check_item *not*, because I have around 200 combat items lol

Is there a code/condition which checks if the player has NOTHING equipped on them? I understand that checking the inventory too would be something manually do.

 



#2
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

I have an island inhabited by monks who allow people with no weapons and armour on, including inventory.

It would be an incredible pain in the ass if I had to use the ga_equipped *not* / ga_check_item *not*, because I have around 200 combat items lol

Is there a code/condition which checks if the player has NOTHING equipped on them? I understand that checking the inventory too would be something manually do.


Hi K Kin,

Do you mean "NOTHING" or "no armour and weapons"?

If you mean "NOTHING" then GetFirstItemInInventory returning OBJECT_INVALID would confirm inventory is empty.

If, however, you mean no weapon or armour (which is what I think you mean), then cycle through inventory using a loop and check if it is a ranged or melee weapon ... or armour.

I do not have access to the toolset at the moment, but there are functions that check if an item is a weapon or piece of armour. I think its something like GetIsWeapon or something like that. Sorry, I also cannot confirm the include its in either at the moment, but I am guessing its something like "ginc_items" ... although that is just me guessing.

Cheers,
Lance.

#3
kamal_

kamal_
  • Members
  • 5 240 messages

I scripted Crimmor so you can be patted down for weapons, it includes a whole system of clothing and armor specifically designed to hide weapons on yourself to get past weapon checks, including lead lined options to hide from even magical detection, allows exceptions by weapon type if you want (only blunt weapons allowed here...), and includes weaponry specifically designed to be hidden (spring loaded daggers and such). You could need to modify that scripting to meet your needs.

 

If you really don't want exceptions, you just cycle through equipped and inventory of the party and check whether the item is a weapon or armor.



#4
K Kin

K Kin
  • Members
  • 109 messages

Hi K Kin,

Do you mean "NOTHING" or "no armour and weapons"?

If you mean "NOTHING" then GetFirstItemInInventory returning OBJECT_INVALID would confirm inventory is empty.

If, however, you mean no weapon or armour (which is what I think you mean), then cycle through inventory using a loop and check if it is a ranged or melee weapon ... or armour.

I do not have access to the toolset at the moment, but there are functions that check if an item is a weapon or piece of armour. I think its something like GetIsWeapon or something like that. Sorry, I also cannot confirm the include its in either at the moment, but I am guessing its something like "ginc_items" ... although that is just me guessing.

Cheers,
Lance.

I mean't nothing, woops :P The caps were meant to mean that nothing at all.



#5
K Kin

K Kin
  • Members
  • 109 messages

I scripted Crimmor so you can be patted down for weapons, it includes a whole system of clothing and armor specifically designed to hide weapons on yourself to get past weapon checks, including lead lined options to hide from even magical detection, allows exceptions by weapon type if you want (only blunt weapons allowed here...), and includes weaponry specifically designed to be hidden (spring loaded daggers and such). You could need to modify that scripting to meet your needs.

 

If you really don't want exceptions, you just cycle through equipped and inventory of the party and check whether the item is a weapon or armor.

Thanks, I'll download it! What's the script called so I can find it easier?



#6
kamal_

kamal_
  • Members
  • 5 240 messages

You can look at the conversation called "sh_docks_nellard_doorguard" in the docks module. There is a script called gc_sh_hidden_pocket_armor_frisk, where a doorguard in the docks frisks you for weaponry. The door guard for a merchant at the riverfront will not unlock the door for you unless you pass the check.

 

You can look in the campaign folder for the gc_sh_ set of scripts, as there are a couple of levels of checks, depending on how thoroughly you want to check the party.



#7
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

Hi K Kin,

 

Sorry, I am getting a little confused with what you are asking ... :huh: For instance, "Check Nothing Equipped" (your title), would mean you are just checking that the PC does not have items equipped (but may be holding them in their inventory). However, your opening line in your original post implies you are then checking they have "no armour or weapons" either "equipped" or "in their inventory". Your last response, implies nothing at all in either "equipped" or "in their inventory".

 

Just to help you explain what you need .... Checking for items "equipped" is not the same as "checking for items carried (either equipped or in their inventory)". And, just to be clear, checking for just weapons or armour is NOT the same thing as checking for other items that may also be equipped or just being carried.

 

However, maybe taking a look at Kamal's script is the best solution for you, as that may help explain some things in general anyway. ;)

 

The question is hard to answer because I am not clear what it is you actually are asking, which may be due to you not yet fully being able to distinguish the way equipment (all types, including armour and weapons) are differentiated one from another, and how they relate to different aspects of script. I hope what I say makes sense and you take it the right way ... no offense is meant by it. :)

 

Regards,

Lance.



#8
K Kin

K Kin
  • Members
  • 109 messages

Yeah, I realized that after I posted because I'd like the player to aboard the ship with food and other items xD

I guess this might be too hard to do after all, because I have no storage. I have a bank mod which only stores gold, but I haven't been lucky enough to find a bank mod which stores items. Maybe I'm not trying hard enough.

But yeah, to clear things up, what I meant was;

You can't carry armour or weapons (equipped or in inventory) onto the island.



#9
kamal_

kamal_
  • Members
  • 5 240 messages

I guess this might be too hard to do after all, because I have no storage. I have a bank mod which only stores gold, but I haven't been lucky enough to find a bank mod which stores items. Maybe I'm not trying hard enough.

If this isn't a PW, the party can just put anything into a convenient chest, armor rack etc. That's what I did for Crimmor, just put armor racks right there and had the door guard tell the pc that he would watch their stuff.



#10
K Kin

K Kin
  • Members
  • 109 messages

If this isn't a PW, the party can just put anything into a convenient chest, armor rack etc. That's what I did for Crimmor, just put armor racks right there and had the door guard tell the pc that he would watch their stuff.

 

Unfortunately it's a PW :P

I plan at sometime in the future making a semi-bank system for our PW.

Not an official storage facility, but it will swap your items for a noted version which weighs nothing and un-useable.



#11
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

Yeah, I realized that after I posted because I'd like the player to aboard the ship with food and other items

I guess this might be too hard to do after all, because I have no storage. I have a bank mod which only stores gold, but I haven't been lucky enough to find a bank mod which stores items. Maybe I'm not trying hard enough.

But yeah, to clear things up, what I meant was;

You can't carry armour or weapons (equipped or in inventory) onto the island.


Hi K Kin,
 
I note in a later post that this is for a PW.
 
Personally, I think what you are asking in this post (about checking for armour and weapons onto an island) is relatively straightforward. HOWEVER, at this stage of my own skills and abilities, setting up a PW is out of my league.
 
What I am trying to say is that I think you may want to lower your ambitions regarding a PW and, instead, try to get a working module for a SP at this stage of your campaign development. Once you have mastered that, like coding for this sort of thing you ask here about checking for armour and weapons, then moving onto doing something for a PW might be the next step.
 
If I have misjudged you, I very much apologise. I am just trying to save you a lot of struggling in deep water, when its best to enjoy a gentle swim to begin with. :) I would not want to see you discouraged from your ambition just because you nearly drown.
 
I'll edit back in a short while letting you know which include file to look into regarding what you need to do.
EDIT: OK, I'm back, and the include file is the one I mentioned earlier ... ginc_items.
 
Here is just one useful function in there ....
 

// Is this a weapon of any type (including ammunition).
int GetIsWeapon(object oItem)
{
	return(IPGetIsMeleeWeapon(oItem) || IPGetIsRangedWeapon(oItem) || IPGetIsProjectile(oItem));
}

 
Cheers,
Lance.



#12
Tchos

Tchos
  • Members
  • 5 042 messages

Heh, if Lance Botelle tells you he thinks you should scale things back a bit, he probably knows what he's talking about.  :wizard: