Will this work in the way its meant to? Please check

Post » Tue May 17, 2011 3:22 am

its supposed to:
1) make chance to harvest something from plants equal to survival skill
2) give a chance for extra "harvest" depending on survival skill
3) harvest amount: at skill 25: 0-1, 50: 0-2, 75: 0-3, 100: 1-4

short chanceshort Skillshort fruitsshort maxharvestbegin onActivate	if State == 0 && GetActionRef == player		set chance to GetRandomPercent		set Skill to player.getav Survival		set maxharvest to (skill / 25)				If MaxHarvest < 1			set MaxHarvest to 1		EndIf		If Skill >= chance ;chance to harvest			; calculate number of fruits			set fruits to (GetRandomPercent / 50) + (skill / 50)                        If fruits < 1                                set fruits to 1                        EndIf			If fruits > MaxHarvest				set fruits to MaxHarvest				player.additem NVFreshHoneyMesquiteFruit fruits			Else				player.additem NVFreshHoneyMesquiteFruit fruits			EndIf		Else			set State to 1			playGroup Forward 1			setdestroyed 1		endif			set State to 1			playGroup Forward 1			setdestroyed 1	endifend

User avatar
Sweets Sweets
 
Posts: 3339
Joined: Tue Jun 13, 2006 3:26 am

Post » Tue May 17, 2011 1:05 am

I am a total infant in scripting now, and can't say for sure if it will work as needed, I don't know if you have it already but http://www.newvegasnexus.com/downloads/file.php?id=36290 brings back the script checker our FO3 GECK had so it will let you know if you have any errors in your script. It also does some other good things as well but it has helped me, well untill maybe we can get an GECK update :ermm: Bethesda


bigcrazewolf
User avatar
Madison Poo
 
Posts: 3414
Joined: Wed Oct 24, 2007 9:09 pm

Post » Tue May 17, 2011 2:47 pm

Looks to me like it will work. There will be a jump in the extra bonus possibliity if skill is over 50, which is fine, if that's what you want.
User avatar
Bryanna Vacchiano
 
Posts: 3425
Joined: Wed Jan 31, 2007 9:54 pm

Post » Tue May 17, 2011 8:31 am

great thanks. please also advise if there's a more "elegant" (from GECK wiki :D) way of writing it.

@wolf
yes i have the geck-pu. the script saved so i guess no errors as far as syntax (?) is concerned. was just afraid it wouldnt work as advertised though.
User avatar
Paul Rice
 
Posts: 3430
Joined: Thu Jun 14, 2007 11:51 am

Post » Tue May 17, 2011 4:42 am

another question. upon testing i found that items added thru the above script dont display a message that an item was added. How do i use the ShowMessage function to make a message that says either:

1) You have succesfully harvested (number equal to variable "fruits") Broc Flower (or other item).
2) You fail to harvest anything.

thanks!
User avatar
Kitana Lucas
 
Posts: 3421
Joined: Sat Aug 12, 2006 1:24 pm

Post » Tue May 17, 2011 12:43 am

ShowMessage [object name] [integer with the harvested number]

You need to place %.0f (for whole numbers) in the message object's text to work with the above.
User avatar
JaNnatul Naimah
 
Posts: 3455
Joined: Fri Jun 23, 2006 8:33 am

Post » Tue May 17, 2011 2:18 am

To clarify: object name is the EditorId of the message right? what about [integer of the harvested number]? i have set the variable "fruit" to represent the number of items harvested from a plant. since, it can change everytime a harvestable plant is activated and id like the message to reflect that change.
User avatar
CArlos BArrera
 
Posts: 3470
Joined: Wed Nov 21, 2007 3:26 am

Post » Tue May 17, 2011 6:51 am

Something like this as an example:

Script:
ShowMessage HoneyMesquiteFruitHarvestCount, fruit


Then the message text of the message object HoneyMesquiteFruitHarvestCount:

Honey Mesquite Fruit Harvested: %.0f


Edit - more info: http://geck.gamesas.com/index.php/ShowMessage
User avatar
brenden casey
 
Posts: 3400
Joined: Mon Sep 17, 2007 9:58 pm

Post » Tue May 17, 2011 3:25 am

to my embarassment i actually read the geck wiki several times over before finally giving up and posting here. thanks, i will try that. your example is easier to understand than the wiki's. will it work as well if "fruit" is a global?
User avatar
priscillaaa
 
Posts: 3309
Joined: Sat Dec 30, 2006 8:22 pm

Post » Tue May 17, 2011 6:05 am

Yes, http://geck.gamesas.com/index.php/ShowMessage should be able to take global variables as parameters.

Cipscis
User avatar
mike
 
Posts: 3432
Joined: Fri Jul 27, 2007 6:51 pm

Post » Tue May 17, 2011 3:54 am

it worked! again, thanks guys :bowdown:
User avatar
Jinx Sykes
 
Posts: 3501
Joined: Sat Jan 20, 2007 11:12 pm


Return to Fallout: New Vegas