Script for a Bow? Is this even possible?

Post » Tue Jan 19, 2016 7:49 am

Is it possible to write a script for a longbow which means it can only fire certain kinds of arrows? For my project, I would need it to fire five different arrows, but would give you a messagebox if you try to use any other arrow with it. I'm not even sure this is possible, but if it is... can anyone out there write me this script? Please? I'd be most grateful.



Thanks in advance.

User avatar
Penny Wills
 
Posts: 3474
Joined: Wed Sep 27, 2006 6:16 pm

Post » Tue Jan 19, 2016 8:50 pm

Everything is possible. :)


Here's a script to make "custom bow" only able to fire daedric/ebony/glass/silver arrows. You should be able to adapt it to your needs:



begin bow_script

float delay

if ( player->HasItemEquipped "custom bow" )
if ( delay > 0 )
set delay to ( delay - GetSecondsPassed )
elseif ( player->GetSoundPlaying bowPull )
if ( player->HasItemEquipped "daedric arrow" )
elseif ( player->HasItemEquipped "ebony arrow" )
elseif ( player->HasItemEquipped "glass arrow" )
elseif ( player->HasItemEquipped "silver arrow" )
else; player is firing the wrong type of arrow!
set delay to 0.5
player->StopSound bowPull
player->AddItem VFX_DefaultBolt 1
player->Equip VFX_DefaultBolt
player->RemoveItem VFX_DefaultBolt 1
MessageBox "This bow can only fire daedric, ebony, glass, or silver arrows!"
endif
endif
endif
end
User avatar
FoReVeR_Me_N
 
Posts: 3556
Joined: Wed Sep 05, 2007 8:25 pm

Post » Tue Jan 19, 2016 6:48 am

Thankyouthankyouthankyouthankyouthankyou!!!



This is incredible. You are amazing. Thanks again! *cackles evilly as he runs off with the script*

User avatar
Lucy
 
Posts: 3362
Joined: Sun Sep 10, 2006 4:55 am

Post » Tue Jan 19, 2016 12:07 pm


I had no idea you can do this kind of thing. Thank you! :icecream:

User avatar
Jeremy Kenney
 
Posts: 3293
Joined: Sun Aug 05, 2007 5:36 pm


Return to III - Morrowind