Law System Fail
Posted: April 30th, 2012, 9:07 pm
I'm making a law system for my rpg. There are men and woman who wander the streets of cities and towns, and killing one causes a variable to be set to 2. If this variable is at 2 then the guards will attack you on sight, and upon your death the variable is set back to 0, so guards will act normally. It seems that the script for people is working, but the guards will not attack you even after killing many people.
Men and women's script.
Guard's script.
I've tried changing a lot of things but nothing seems to help. Anybody know what's wrong. I also want to figure out more about variables so it's easier to make quests.
Code: Select all
include scripts/1
]
r_script_signal hit [
r_action_clear self
r_action_attack self actor
r_sound "iolar/slice"
]
]
]
r_script_signal spawn [
r_action_wander self 0 256 0
r_additem self 8 1
r_equip self 8 0
]
]
]
r_script_signal attacksound [
r_sound "iolar/attack" self
]
]
r_script_signal death [
r_sound "iolar/citizendie"
]
Code: Select all
include scripts/1
r_script_signal talk [
if (!= (r_get_faction self) (r_get_faction actor)) [
r_action_clear self
r_action_attack self actor
if (= (r_get_faction self) (r_get_faction actor)) [
r_sound "Iolar/greet" self
]
]
r_script_signal hit [
r_action_clear self
r_action_attack self actor
r_sound "Iolar/slice" self
]
]
r_script_signal update [
if (r_cansee self player) [
(case r_global_get $highfrostcriminal)
if r_global $highfrostcriminal = 2
r_action_clear self
r_action_attack self player 1
]
]
r_script_signal collide [
if (!= (r_get_faction self) (r_get_faction actor)) [
r_action_clear self
r_action_attack self actor
]
]
r_script_signal spawn [
r_additem self 2 1
r_equip self 2 0
]
I've tried changing a lot of things but nothing seems to help. Anybody know what's wrong. I also want to figure out more about variables so it's easier to make quests.