Need help for weapon asset...

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
Pandafox
Posts: 268
Joined: Wed Apr 11, 2012 11:25 pm
Location: France
Contact:

Need help for weapon asset...

Post 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 !
User avatar
Pandafox
Posts: 268
Joined: Wed Apr 11, 2012 11:25 pm
Location: France
Contact:

Re: Need help for weapon asset...

Post by Pandafox »

Nobody?
Not possible to do?
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Need help for weapon asset...

Post 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
Finished Dungeons - complete mods to play
User avatar
Diarmuid
Posts: 807
Joined: Thu Nov 22, 2012 6:59 am
Location: Montreal, Canada
Contact:

Re: Need help for weapon asset...

Post 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.
User avatar
Pandafox
Posts: 268
Joined: Wed Apr 11, 2012 11:25 pm
Location: France
Contact:

Re: Need help for weapon asset...

Post 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 ;)
User avatar
Diarmuid
Posts: 807
Joined: Thu Nov 22, 2012 6:59 am
Location: Montreal, Canada
Contact:

Re: Need help for weapon asset...

Post 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.
Post Reply