I've got a few issues that don't seem to be resolving:
1. UT_AddItemToInventory not adding an item to an NPC's inventory.
The call is:
UT_AddItemToInventory(R"am101it_tavern_key.uti", 1, GetObjectByTag("am101cr_barkeep"), "am101it_tavern_key", FALSE, TRUE);
Yet I'm not seeing the item created. Yes, the tags and resource names are correct - I'm referencing them elsewhere in the same script and they work.
And I can't just have the item in the creature's inventory to start with, as I only want it to be added under certain circumstances. I also tried putting it in there and then removing it when necessary, but that didn't seem to work either.
2. Switching weapon sets.
The basic idea is that I want NPCs to not appear to have any weapons, but if trouble occurs, they will switch weapon sets and then start attacking. So I have creatures set up with an empty weapon set 1, and then have their weapons in weapon set 2. The idea would be to have the creatures switch weapon sets, then go hostile.
However, the creatures only turn hostile, and end up attacking with their bare fists instead of proper weapons, which isn't really a desirable situation.
WR_AddCommand(GetObjectByTag("am100cr_thug1"), CommandSwitchWeaponSet(), TRUE);
UT_TeamGoesHostile(AOM_TEAM_THUGS);
I tried simply using the SwitchWeaponSet() command on the NPC too, but similarly it yielded no results.
Two NPC Script Problems
Débuté par
AmstradHero
, janv. 03 2010 03:39
#1
Posté 03 janvier 2010 - 03:39
#2
Posté 03 janvier 2010 - 04:05
1. Do you have multiple instances of creatures with the same tag (e.g. one that you copied but forgot to change the tag on)? Did you remember to export all the relevant resources?
2. Have you tried SwitchWeaponSet? The problem is likely that the command you are assigning (which is not a static command) is getting cleared as soon as combat starts.
2. Have you tried SwitchWeaponSet? The problem is likely that the command you are assigning (which is not a static command) is getting cleared as soon as combat starts.
#3
Posté 03 janvier 2010 - 05:06
I'd done both of those - but I just found the reason for the issue. I'd switched the plot script from a module resource to a core resource at about 1:30am before I went to bed. I thought that plot scripts should be core resources as opposed to module resources, but given they'll only be called when your module is loaded, I suppose that isn't necessary?
Anyway, module resources take precedence over core resources, hence the changes I was making to the script (where it should have been adding that item and making the combatants switch weapon sets), were being completely ignored because of the old copy of the script in the module's toolsetexport directory.
I am now dutifully embarrassed.
Anyway, module resources take precedence over core resources, hence the changes I was making to the script (where it should have been adding that item and making the combatants switch weapon sets), were being completely ignored because of the old copy of the script in the module's toolsetexport directory.
I am now dutifully embarrassed.





Retour en haut






