Aller au contenu

Photo

Combat mode never stops


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

#1
georage

georage
  • Members
  • 247 messages
I have a small room with rats. If I fight the rats, I can never leave the room because the PC stays in combat mode.

I even tried scripting a trigger to SetCombatState to FALSE and he still can't open doors.

I have read other posts that say clear an override folder, which I have done, but I still cannot exit combat stance.

The bodies of the rats disappear, so I think my area_core and creature_core scripts are firing properly.

Any clues?


 

#2
FollowTheGourd

FollowTheGourd
  • Members
  • 572 messages
Not especially, but if you're doing custom core scripts, I'd check to make sure the perceive/unperceive events are firing normally and taking the proper code path.

It's been a while since I checked, but that's what I recall going in and out of combat mode was triggered by.

Modifié par FollowTheGourd, 23 décembre 2009 - 10:17 .


#3
georage

georage
  • Members
  • 247 messages
I tried this as a test ... the player has no valid attack target and even when the player's threat table is cleared he stays in combat mode.



//////////////////////////////////////

//take player out of stuck combat mode

//////////////////////////////////////

if(GetCombatState(oPC))

if(IsObjectValid(GetAttackTarget(oPC)))

{

DisplayFloatyMessage(oPC, "Enemy: "+GetName(GetAttackTarget(oPC)), FLOATY_MESSAGE, S_FLOATY_COLOR, F_FLOATY_TIME);

}

else //no enemy

{

ClearThreatTable(oPC);

DisplayFloatyMessage(oPC, "No enemies", FLOATY_MESSAGE, S_FLOATY_COLOR, F_FLOATY_TIME);

}

#4
georage

georage
  • Members
  • 247 messages
double post

Modifié par georage, 23 décembre 2009 - 10:22 .


#5
SilentCid

SilentCid
  • Members
  • 338 messages
try adding this line towards the end of your script:



{

HandleEvent(ev, RESOURCE_SCRIPT_AREA_CORE);

}





This will include the area_core script that you took out. area_core has some of the much needed functions like taking your character out of combat.

#6
georage

georage
  • Members
  • 247 messages
No, the area core script is still firing.



I think I have my event override working correctly. i have my engineevents pointing to my scripts first, but both have event handlers at the end directing my script to run the core scripts.



area_core and creature_core are both firing, and I've not tampered with them.



i am flummoxed.

#7
SilentCid

SilentCid
  • Members
  • 338 messages
I could take a look at your problem if you're willing to create a builder to builder file for me to look at.

#8
georage

georage
  • Members
  • 247 messages
Wow, that's quite an offer SilentCid, but I think I fixed it.

I must not understand how overrides work.

I have created an engineevents 2DA, and had most of the events pointing to my scripts and not the core scripts. I removed all of those except module load and the perception ones and the heartbeat one and all is well!

Here is how I thought it worked.

1) Create a 2DA that directs events to your custom scripts instead of the _core scripts.
2) Create custom scripts and make them the script attached to your area, creatures, etc.
3) Have an event handler execute the bioware core scripts at the end of your custom script.

Is that not correct?

I am so happy it is working ... but I'd like to know how I screwed this up.

Modifié par georage, 24 décembre 2009 - 02:11 .


#9
FalloutBoy

FalloutBoy
  • Members
  • 580 messages
If you are assigning your items/creatures/areas/whatever to use a custom script, you can skip step 1. The engineevents overrides are for people who are modding an existing module. If you are making your own module, you can use any handler you want to write and assign it to your object.



You still want to call the default handler at the end of your custom handler though.


#10
georage

georage
  • Members
  • 247 messages
Egad!



I have been doing this all wrong then.