I was wondering if anybody could help me set up a script call that would: Return true, if an NPC's alignment has been altered.
Thanks for your time,
JC
Conditional Branch >> Script
$BlizzABS.is_enemy?(id) && $game_map.events[id].ai.altered_alignment
Replacing
id with the event's ID
Thanks for the script call, but it doesn't seem to work the way I want it to. I may be off in left-field here with what I'm trying to do, so please pardon my ignorance. I'm trying check a specific NPC (alignment group) to see if he has turned hostile, after being attacked (whether by accident or on purpose :haha:). So I'm not 100% sure if altered_ alignment is the right variable to check.
The reason I'm checking to see if the character has turned hostile, is so I can turn on a switch to change his event page; that way the NPC will not initiate dialog while he/she is hostile. It's very possible I'm going about this completely the wrong way.
What is the best way to handle dialog with an NPC in Blizz-ABS when they turn hostile?
How did you use the script call? Is it through a common event? Parallel process? Within the NPC event?
I had planned on using it within the NPC event, but after reading your first reply, I created a parallel process with a conditional-branch, that turned a switch on/off, based upon the result. So the actual SCRIPT-CALL you gave me was used in the SCRIPT check for the conditional-branch. I also tried to get to work in other ways as well.
Oh I happened to find something unexpected. I tried doing this within the actual event:
QuoteComment: Trigger:ActionButton
Cond. Branch: $BlizzABS.is_enemy?(1) && $game_map.events[1].ai.altered_alignment
>
Else:
> Text: Hi.
Branch End
So it all works out the first time I talk to it.
Now I attack it. Turns out that the second time I talked to the event,
altered_alignment switched back to false, even though the event is still attacking me. This part will mean nothing to you, but it's calling
setup_group again.
I'll have to look into this more.
Thanks for being awesome!!! Man, I searched all over for solution to this before asking. ;)
I just wanted to say that the problem I was having was resolved using the SCRIPT-CALL given above. I used the SCRIPT-CALL in a CONDITIONAL BRANCH of a PARALLEL PROCESS. If the SCRIPT-CALL returned TRUE, I had it turn ON a SWITCH. When the SWITCH was ON, my "hostile event" would no longer allow the actor to talk to it.
For anybody having trouble checking for ALTERED-ALIGNMENT with this SCRIPT-CALL, I would recommend making sure your event's alignment group is NOT set to NEUTRAL (as stated in the manual). Also make sure that the ALIGNMENT GROUPS (allies, enemies, NPCs, Guards, etc...) are all set up right (using the config program).
The other problem mentioned above, calling the SETUP_GROUP, I have no idea on, but it doesn't seem to be affecting my game.
Also, make sure you're currently using the latest version of Blizz-ABS.
QuoteThe other problem mentioned above, calling the SETUP_GROUP, I have no idea on, but it doesn't seem to be affecting my game.
Well yeah, it wouldn't affect you because you did this
QuoteIf the SCRIPT-CALL returned TRUE, I had it turn ON a SWITCH. When the SWITCH was ON, my "hostile event" would no longer allow the actor to talk to it.
If you were to make it so that if the SCRIPT-CALL returned FALSE and turn OFF a SWITCH, you will see the same error I was getting.
Regardless, I'm still curious as to why BlizzABS sets
altered_alignment back to false after triggering the event/enemy.
Thanks for the reply. I made a video showing how I'm using the SCIRPT-CALL. I still think I might be missing something, but I want to make sure before I get too far down the road.
Here is the video demonstrating how I'm employing the SCRIPT-CALL:
http://www.youtube.com/v/=K6wg3jC7LEo
Thanks again! :)
http://www.youtube.com/watch?v=K6wg3jC7LEo (In case flash format is wrong)
I fixed the link above, so it should work now. (I accidentally posted the link I used for the flash link)
Yeah, the video doesn't even begin to demonstrate the bug I found. Try talking to the hostile event and see what happens.
Glad to be of service :)