Help with Factions and Weapons 1.2.8
Posted: January 16th, 2013, 6:53 am
Hi,
I need to set a faction to hate me as soon as I enter the game, for example; walking around a nice field you come across a nasty wolf... we he doesn't want to attack me unless I attack him first. But i would like it so that from the start of the game he wants to kill me with no way to change the faction.
Secondly I'm having some trouble in 1.2.8 with giving enemies weapons. For example I'd like to make a fire breathing dragon, I followed the RPG tutorial and all i get is an error in game:
Naturally I have the same issue that it won't attack me unless I attack it first, however that's an issue in itself as my first weapon doesn't actually cause any damage, It simply just pushes things around. The idea is to push the dragon into a huge lava pit... Without it killing you first! Now When I load the game and drop the waypoints and everything, the dragon charges at me (which I don't really want it to be face to face with me, so is there a way to stop it from charging at you and just stay at a certain distance?) but then i get an error that states
Now I've tested the weapon in question and I can equip it no problem and can use it. After killing the dragon (using another weapon that does damage) I went over and looted it and the weapon appears in it's inventory for me to loot... so the "r_additem" is working, it just doesn't want to equip the weapon.
I'm currently just testing it with the tutorial "fangs" and then I will change it later once i can get it working.
Any help on this post would be most appreciated!
I need to set a faction to hate me as soon as I enter the game, for example; walking around a nice field you come across a nasty wolf... we he doesn't want to attack me unless I attack him first. But i would like it so that from the start of the game he wants to kill me with no way to change the faction.
Secondly I'm having some trouble in 1.2.8 with giving enemies weapons. For example I'd like to make a fire breathing dragon, I followed the RPG tutorial and all i get is an error in game:
Code: Select all
//Dragon Script
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
]
]
r_script_signal hit [
if (!= (r_get_faction self) (r_get_faction actor)) [
r_action_clear self
r_action_attack self actor
]
]
r_script_signal update [
if (r_cansee self player) [
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_action_wander self 0 50 0
r_additem self 2 1
r_equip self 2 0
]
Code: Select all
r_equip; invalid reference "2" or of incompatible type
I'm currently just testing it with the tutorial "fangs" and then I will change it later once i can get it working.
Code: Select all
r_item_name "Fangs"
r_item_description "If you see this, submit a bug report."
r_item_use_new_weapon // 0
r_item_use_cooldown 100
r_item_use_chargeflags $CHARGE_MAG
r_item_use_new_status 1 $ATTACK_SLASH .075
r_item_use_slots (| $SLOT_LHAND $SLOT_RHAND |)
r_item_use_skill $SKILL_MELEE
r_item_use_range 4
r_item_use_angle 8 //degrees
r_item_use_lifetime 0
r_item_use_cost 0
r_item_use_target $T_HORIZ
r_item_use_recoil -10
r_item_use_projeffect -1
r_item_use_traileffect -1
r_item_use_deatheffect -1