-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do you set a weapon to the player programmatically? #1
Comments
The equip command can be used, but the weapon needs to be spawned first and the equip needs to be triggered from the weapon:
Remaining questions before the method can be marked as fully implementable into the arena custom map:
|
Answers:
|
The equip command can be triggered by sending an inventoryuse event. Gluing the spawning together with equipping creates this one-liner:
|
another issue: can't equip the weapon, if the stats are no met (the sabre needs 8 strength) |
yet another issue: if the player is in combat mode, then the weapon is not being equipped. Any other ways to trigger the equip command from within the weapon? |
This is what I have so far for the player to make sure that it remembers the previously added weapon and destroying it upon changing the weapon: // player.asl
ON INIT {
SET £lastEquippedWeaponId "none"
ACCEPT
}
ON CHANGE_WEAPON {
if (£lastEquippedWeaponId != "") {
destroy £lastEquippedWeaponId
}
spawn item "weapons/~^$PARAM1~/~^$PARAM1~" player
sendevent INVENTORYUSE ~^last_spawned~ nop
set £lastEquippedWeaponId ~^last_spawned~
ACCEPT
} And triggering a weapon change looks like this: // param1:weaponType = "club"
// param2:damage = 1
sendevent change_weapon player "club 1" |
player.setweapon bone_weap
puts the correct weapon on the player's back, but in combat mode the player does not use it. Furthermore the weapon cannot be unequipped.There seems to be no command to assign a weapon to the player ( https://wiki.arx-libertatis.org/Script:Commands )
Can I attach the weapon to the player's hand or would that be always visible even when the weapon is holstered?
The text was updated successfully, but these errors were encountered: