Question Regarding OnEquip

Post » Sat May 28, 2011 9:45 am

I'm new to scripting, for fallout anyways, and regret saying that the tutorials are not written very well, and therefore, somewhat difficult to understand at times. I'm attempting to write a script that is linked to an item, the items are Ingestible food items and I want to confirm that using Begin onEquip Player will work? Thanks ^_^ *Sorry for the noob question*
User avatar
Andrew
 
Posts: 3521
Joined: Tue May 08, 2007 1:44 am

Post » Sat May 28, 2011 7:08 am

Man, everyone complanes about the tutorials... I had no trouble with them :/

Anywho thats beside the point. I think OnEquip should work. However you can probably do whatever you are trying to with an item effect, and put that on the item instead. What exactly do you want to happen when the player eats said item?
User avatar
Angus Poole
 
Posts: 3594
Joined: Fri Aug 03, 2007 9:04 pm

Post » Sat May 28, 2011 3:18 pm

Ingestibles cannot be equipped (I'm fairly certain), so OnEquip/Unequip aren't applicable for ALCH forms. Check out Beth's Psycho ingestible and you should be able gain some insight.

Edit: Just tested and code within OnEquip and OnUnequip blocks didn't fire when attached to an apple. Also, code calling EquipItem or UnequipItem on ingestibles compiled, but halts after inapplicable commands are executed.
User avatar
jenny goodwin
 
Posts: 3461
Joined: Wed Sep 13, 2006 4:57 am

Post » Sat May 28, 2011 2:58 pm

I'm working on a Player Needs system so I just want to create a script that will change GLOBAL variables when the player consumes certain items. Do you know of any other tutorials? I worked with the G.E.C.K "Beginner" tutorial and like I said, it just jumps around a lot and loses me... Truly sad, C++ is a breeze but Fallout scripting is a pain. xD
User avatar
Stephy Beck
 
Posts: 3492
Joined: Mon Apr 16, 2007 12:33 pm

Post » Sat May 28, 2011 11:52 am

You have to apply a 'base effect' to the ingestible that runs an 'effect' script. Effect scripts can only use three block types: ScriptEffectStart, ScriptEffectUpdate & ScriptEffectFinish (http://geck.gamesas.com/index.php/Begin). You also must define the script as an Effect script in the drop down box on the tool bar of the script window.
User avatar
Misty lt
 
Posts: 3400
Joined: Mon Dec 25, 2006 10:06 am

Post » Sat May 28, 2011 8:03 pm

Try a script effect attached to a base effect attached to your ingestible(s), like vanilla's Psycho is set up. All should work well if it's done in a similar manner.
User avatar
CHangohh BOyy
 
Posts: 3462
Joined: Mon Aug 20, 2007 12:12 pm

Post » Sat May 28, 2011 11:56 am

As far as I'm aware, my http://www.cipscis.com/fallout/tutorials/beginners.aspx tutorial is the only general purpose scripting tutorial written specifically for Fallout 3. Is this the one you're talking about?

Changing a global variable when the player uses a consumable item is a very easy task. As the others have said, you'll want to use an effect script that is linked to your ingestible via a base effect, using a http://geck.gamesas.com/index.php/ScriptEffectStart block:
Begin ScriptEffectStart	; Do stuffEnd

Cipscis
User avatar
sharon
 
Posts: 3449
Joined: Wed Nov 22, 2006 4:59 am

Post » Sat May 28, 2011 1:04 pm

I'm curious, does End take arguments? Such as writing a script that goes
Begin ScriptEffectStart
*stuff*
End ScriptEffectFinish
User avatar
Soraya Davy
 
Posts: 3377
Joined: Sat Aug 05, 2006 10:53 pm

Post » Sat May 28, 2011 6:15 pm

End just ends the last begin.
User avatar
Scott Clemmons
 
Posts: 3333
Joined: Sun Sep 16, 2007 5:35 pm

Post » Sat May 28, 2011 3:32 pm

And you cannot insert a 'begin' block inside another begin block.
User avatar
Julie Serebrekoff
 
Posts: 3359
Joined: Sun Dec 24, 2006 4:41 am


Return to Fallout 3

cron