Problem with script in quest

Post » Mon Mar 14, 2011 5:48 pm

Hello there, I wanted to do same thing with quest what AmmoWeight and Sprint mods do. They put the script into quest, so it works all the time and I have problem because I tried to do the same thing, but my script isn't on the list. I tried to copy the script, but it still isn't on the list... Can anyone help me? I'm trying to make script for Power Armors and Heavy Weapons which makes player slower when he is wearing them.
User avatar
:)Colleenn
 
Posts: 3461
Joined: Thu Aug 31, 2006 9:03 am

Post » Tue Mar 15, 2011 3:52 am

When you save the script it needs to be saved as a script type of 'Quest'.

The default script type is 'Object' which is probably what you saved it as. Use the drop-down box on the script window to change it to quest and re-save it.
User avatar
Timara White
 
Posts: 3464
Joined: Mon Aug 27, 2007 7:39 am

Post » Mon Mar 14, 2011 8:28 pm

When you save the script it needs to be saved as a script type of 'Quest'.

The default script type is 'Object' which is probably what you saved it as. Use the drop-down box on the script window to change it to quest and re-save it.


Ok it works, thanks :) now I have another problem, because script doesn't work as intended, but I will make new topic for it.
User avatar
Verity Hurding
 
Posts: 3455
Joined: Sat Jul 22, 2006 1:29 pm

Post » Tue Mar 15, 2011 12:13 am

No need for a new topic, just post the script up and let us know what it should be doing and maybe we can help.
User avatar
Alexandra Ryan
 
Posts: 3438
Joined: Mon Jul 31, 2006 9:01 am

Post » Tue Mar 15, 2011 2:08 am

No need for a new topic, just post the script up and let us know what it should be doing and maybe we can help.


Ok, so this is my script:

begin GameMode        if player.GetActorValue Strength >= 8          player.EquipItem WeapMinigun  			player.modav SpeedMult -50       else            player.UnEquipItem WeapMinigun			 player.modav SpeedMult 50			ShowMessage StrMinigunMsg        endif    endifend


Before was "Begin OnEquip" instead of "Begin GameMode", because I couldn't choose "Begin OnEquip" when I changed script from Object to Quest. I want to make speed penalties for Power Armors and Heavy Weapons in game, but with this script it automatically equips Minigun every few seconds and I would like to make script to work only when I want to equip the gun. I have FOSE installed.
User avatar
Undisclosed Desires
 
Posts: 3388
Joined: Fri Mar 02, 2007 4:10 pm

Post » Mon Mar 14, 2011 9:29 pm

Do you want the effect to kick in automatically when the player has the minigun equipped? You should use getEquipped instead then, like this:
SCN scriptnameshort doOncebegin GameMode     if player.GetActorValue Strength >= 8        if player.getEquipped WeapMinigun == 1            if doOnce == 0                player.modav SpeedMult -50                showMessage strMiniGunMsg                set doOnce to 1            endif        elseif player.getEquipped WeapMinigun == 0            if doOnce == 1                player.modav SpeedMult 50                set doOnce to 0            endif        endif   endifEnd

User avatar
Kirsty Wood
 
Posts: 3461
Joined: Tue Aug 15, 2006 10:41 am

Post » Mon Mar 14, 2011 1:57 pm

Do you want the effect to kick in automatically when the player has the minigun equipped? You should use getEquipped instead then, like this:
SCN scriptnameshort doOncebegin GameMode     if player.GetActorValue Strength >= 8        if player.getEquipped WeapMinigun == 1            if doOnce == 0                player.modav SpeedMult -50                showMessage strMiniGunMsg                set doOnce to 1            endif        elseif player.getEquipped WeapMinigun == 0            if doOnce == 1                player.modav SpeedMult 50                set doOnce to 0            endif        endif   endifEnd




Not at all, I want player to let him equip Minigun only if he has 8 or more strength and this script allows him to equip it even with 5 STR. I think "if player.getEquipped WeapMinigun == 1" is wrong, because it shouldn't be if he has already equipped gun, but when he want to equip, so that formula should be later. And 2nd thing is I want to have ShowMessage only when player has less than 8 STR. I know, it sounds complicated :/
User avatar
Arrogant SId
 
Posts: 3366
Joined: Sat May 19, 2007 11:39 am

Post » Mon Mar 14, 2011 3:30 pm

Not at all, I want player to let him equip Minigun only if he has 8 or more strength and this script allows him to equip it even with 5 STR. I think "if player.getEquipped WeapMinigun == 1" is wrong, because it shouldn't be if he has already equipped gun, but when he want to equip, so that formula should be later. And 2nd thing is I want to have ShowMessage only when player has less than 8 STR. I know, it sounds complicated :/


Well.

Here is some code. Some points about it:

In the past, I used a script tool Cipscis made to test the efficiency of "getequipped" as compared with "isweaponinlist". There was a large difference in the amount of cpu being used between these 2 script commands. Getequipped was an inefficient CPU hog when compared with isweaponinlist for this purpose.

When you are forcing minigun unequips, you want to account for both the real minigun + the unique version of the minigun that comes out of MS18 from the Reilly's Rangers quest anyway. The "RepairMinigun" formlist as it works in the vanilla game works well enough for that.

So, here is some code that's based upon the Azar code and may help with what you are doing. I've never used the SpeedMult thing in a script so I don't know if this does what you expect.

short SpeedMultLoweredbegin gamemodeif player.isweaponinlist RepairMinigun  ; if the player has any minigun equipped	if player.getav strength < 8 ; but he's too weak to be doing that 		player.unequipitem WeapMinigun		player.unequipitem WeapUniqueMS18Minigun	elseif SpeedMultLowered == 0 ; if he's strong enough to equip it but he hasn't had his speed multiplier adjusted yet		set SpeedMultLowered to 1		 player.modav SpeedMult -50	endifelseif SpeedMultLowered ; he's not equipping a minigun but he's been affected by a speed mult change earlier	set SpeedMultLowered to 0	player.modav speedmult 50endifend

User avatar
james reed
 
Posts: 3371
Joined: Tue Sep 18, 2007 12:18 am

Post » Mon Mar 14, 2011 1:06 pm

Thanks, it works great, but there's one problem. Speed penalty doesn't proc immediately, I need to use sprint to let it proc. When I equip Minigun I will have normal speed (100%) and when I used sprint or reload script starts to work and decreases my speed by 50%. Same goes when I change weapon from Minigun to Assault RIfle, I will move at 50% speed until I try to sprint or reload weapon :/ Is there any way to make that script to work instantly?
User avatar
Nymph
 
Posts: 3487
Joined: Thu Sep 21, 2006 1:17 pm

Post » Mon Mar 14, 2011 6:45 pm

Thanks, it works great, but there's one problem. Speed penalty doesn't proc immediately, I need to use sprint to let it proc. When I equip Minigun I will have normal speed (100%) and when I used sprint or reload script starts to work and decreases my speed by 50%. Same goes when I change weapon from Minigun to Assault RIfle, I will move at 50% speed until I try to sprint or reload weapon :/ Is there any way to make that script to work instantly?


speed up the quest timing to 0.1 of a second...

as far as the sprint thing... I really could not tell you. You would need to edit the script to detect whatever it is. I don't know what those things are, I've never sprinted in my game.
User avatar
JR Cash
 
Posts: 3441
Joined: Tue Oct 02, 2007 12:59 pm

Post » Mon Mar 14, 2011 7:21 pm

speed up the quest timing to 0.1 of a second...

as far as the sprint thing... I really could not tell you. You would need to edit the script to detect whatever it is. I don't know what those things are, I've never sprinted in my game.


You are the best :) I changed it to 0.01 and procs immediately, just as I wanted, thanks everyone for help :)
User avatar
Ellie English
 
Posts: 3457
Joined: Tue Jul 11, 2006 4:47 pm

Post » Tue Mar 15, 2011 3:04 am

Btw. will it work on NPCs too, or only on player? Earlier version of script affected only player.
User avatar
Emily abigail Villarreal
 
Posts: 3433
Joined: Mon Aug 27, 2007 9:38 am


Return to Fallout 3