Page 1 of 1
Need help for weapon asset...
Posted: Mon Dec 31, 2012 4:40 pm
by Pandafox
I tried to find a solution by myself but I can't find...
I'm making a special sword asset but I have a problem.
I would like this sword only can hit one special monster.
For exemple, if you try to use this sword to fight a snail or a skeleton or another "normal" monster, you can't hurt it. (0 or miss)
But there is a monster (a monster asset I made) who can't be hurt by anything but this sword !
Is it possible ?
thanks
and Happy new year !
Re: Need help for weapon asset...
Posted: Wed Jan 02, 2013 4:41 pm
by Pandafox
Nobody?
Not possible to do?
Re: Need help for weapon asset...
Posted: Thu Jan 03, 2013 2:52 pm
by Komag
offhand I would guess that it's possible, maybe using a combination of monster onDamage and party onUseItem or onAttack or item onUseItem
Re: Need help for weapon asset...
Posted: Thu Jan 03, 2013 5:53 pm
by Diarmuid
Hi, it's definitely possible. Check what I posted here concerning weapons that can only hit certain monsters, this was to create a "vorpal blade" type of effect:
viewtopic.php?f=14&t=4451#p46316.
For what you ask, you can copy the script and simply set:
Code: Select all
spectralWeaponsHitNormalMonsters = false
spectralMonsters = {
"your_monster_name",
}
spectralWeapons = {
"your_weapon_name",
}
And it should work, the "your_weapon_name" will only hit "your_monster_name" and nothing else (because of spectralWeaponsHitNormalMonsters = false) and "your_monster_name" won't be hit by anything else.
You need to have the framework installed, though.
Ignore the spell part of it, it's old code and I have to update it.
Re: Need help for weapon asset...
Posted: Fri Jan 04, 2013 4:28 pm
by Pandafox
thanks Diarmuid !
It seems to be not so easy... because I don't know what you talk about "framework"...
But I will check it when I will have some free time to understand

Re: Need help for weapon asset...
Posted: Fri Jan 04, 2013 6:01 pm
by Diarmuid
Hi, I mean to install jKos library:
https://sites.google.com/site/jkosgrimrock2/home.
It's not really hard to do, just unzip the file in mod_assets and copy one script to a script entity.