New arrow problem

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
LordGarth
Posts: 500
Joined: Mon Jun 18, 2012 5:07 pm
Location: Colorado USA

New arrow problem

Post by LordGarth »

Hell all.

I have made new arrows and when I shoot and recover them, they are not the same arrow. Each arrow reverts back to broadhead arrow.

I pick them up as steel arrow but when I shoot a monster and the arrow falls and I pick the arrow up later, it is now a broad head arrow.

This is the case wether it is a sharp projectile or not.

Need help

Thx,

LG
Dungeon Master and DOOM will live forever.
User avatar
Grimwold
Posts: 511
Joined: Thu Sep 13, 2012 11:45 pm
Location: A Dungeon somewhere in the UK

Re: New arrow problem

Post by Grimwold »

The sharp property of projectiles means whether it will get stuck in the monster and be dropped when it dies... sharp = gets stuck. blunt = drops to the floor when thrown.
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: New arrow problem

Post by Komag »

You need to define a whole new class IIRC, since all the special arrows are already hardcoded to revert to broadhead after using them.
Finished Dungeons - complete mods to play
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: New arrow problem

Post by msyblade »

I agree,this is a matter of defineObject vs cloneObject. Define a new projectile instead of cloning the original.
Currently conspiring with many modders on the "Legends of the Northern Realms"project.

"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: New arrow problem

Post by Komag »

I think in this case it's also more than that, but I haven't done it myself so I'm not 100% sure. But it came up recently, to do with weapon ammo or something
Finished Dungeons - complete mods to play
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: New arrow problem

Post by msyblade »

I also have not tried this, but I think a workaround is possible. Redefine the sling, with name/pics/models you want, and "ammo" = whatever you want it to shoot. If that does not work, redefine the name of your ammo to rock, (hopefully) keeping the other properties in tact. Again haven't tried this, but i'm betting the "Arrow class" of ammo is hardcoded to revert to broadhead upon use, as Komag suggested.Rock ammo type is not.
Currently conspiring with many modders on the "Legends of the Northern Realms"project.

"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
User avatar
Grimwold
Posts: 511
Joined: Thu Sep 13, 2012 11:45 pm
Location: A Dungeon somewhere in the UK

Re: New arrow problem

Post by Grimwold »

creating a new ammoType seems to work well... here's my "Knife Thrower" (looks like a crossbow!) that fires "knife" ammo

Code: Select all

	defineObject{
		name = "knife_ammo",
		class = "Item",
		uiName = "Knife Ammo",
		model = "assets/models/items/throwing_knife.fbx",
		ammoType = "knife",
		gfxIndex = 42,
		attackPower = 8,
		coolDownTime = 4,
		impactSound = "impact_blade",
		stackable = true,
		sharpProjectile = true,
		projectileRotationSpeed = 0,
		projectileRotationX = 90,
		projectileRotationY = 90,
		weight = 0.2,
	}

	defineObject{
		name = "knife_thrower",
		class = "Item",
		uiName = "Knife Thrower",
		model = "assets/models/items/crossbow.fbx",
		skill = "missile_weapons",
		gfxIndex = 14,
		attackPower = 20,
		coolDownTime = 5.5,
		attackMethod = "rangedAttack",
		attackSound = "swipe_bow",
		impactSound = "impact_blunt",
		rangedWeapon = true,
		ammo = "knife",
		weight = 1.5,
	}
as long as you have an "ammoType=" declaration within the item you want to use as your ammo, that matches with an "ammo = " declaration in your item to use as your weapon.

Of course this means a standard bow will not fire this ammo... but you could redefine the bows and arrows to use a new ammo type, say called "new_arrow".. and use that for all new and existing bows/arrows.
User avatar
Diarmuid
Posts: 807
Joined: Thu Nov 22, 2012 6:59 am
Location: Montreal, Canada
Contact:

Re: New arrow problem

Post by Diarmuid »

I'm very interested in this as well... But if you redefine a new ammo for all arrows and bows, will you lose the functionality of enchanted arrows reverting back to normal? Or if you clone, let's say, a fire arrow it will work?
User avatar
Grimwold
Posts: 511
Joined: Thu Sep 13, 2012 11:45 pm
Location: A Dungeon somewhere in the UK

Re: New arrow problem

Post by Grimwold »

Diarmuid wrote:I'm very interested in this as well... But if you redefine a new ammo for all arrows and bows, will you lose the functionality of enchanted arrows reverting back to normal? Or if you clone, let's say, a fire arrow it will work?
I've just tested it myself using a "newarrow" ammo type for the original arrows and yes, you do lose the reversion (e.g. poison arrows stay as poison arrows after the monster dies)... so that must be hardcoded to the "arrow" ammo type.

There would probably be a workaround using the onProjectileHit() monster hook to convert any fired poison arrows to broadhead arrows. (or possibly onDie() to check for any arrows dropped by the monster)
User avatar
LordGarth
Posts: 500
Joined: Mon Jun 18, 2012 5:07 pm
Location: Colorado USA

Re: New arrow problem

Post by LordGarth »

It works

Just name all new arrows with ammotype "arrow1" and in the bows code ammo = "arrow1",

All new arrows stay what they are. I tried my steel arrows, slayer arrows, ghost arrow and planar arrow.

And they all stayed what they are after hitting a monster.

YAY

I should be getting some ram tomorrow and then I hope I can export to dat file with 8 gig ram.

Then I just have to playtest and I can finally release my game.

LG
Dungeon Master and DOOM will live forever.
Post Reply