How do you script a temporary barter/speech increase

Post » Wed Dec 30, 2009 8:24 am

Title say it all, How do you add a temporary barter/speech increase of a given time ( in seconds )into a script?

Thank you very much!
User avatar
Chris Duncan
 
Posts: 3471
Joined: Sun Jun 24, 2007 2:31 am

Post » Wed Dec 30, 2009 9:22 am

Title say it all, How do you add a temporary barter/speech increase of a given time ( in seconds )into a script?

Thank you very much!


I've been trying to set up a Actor Effect and call it with player.addspell nameofmyobject in my script. I see the message that it has been added but no effect. Also i was wondering can it be achieve using actor value?

I want to give a bonus to barter after a given conversation in a mod, after completing a quest to give the player a discount on his ware for a limited time.
User avatar
Ezekiel Macallister
 
Posts: 3493
Joined: Fri Jun 22, 2007 12:08 pm

Post » Wed Dec 30, 2009 9:47 am

I want to give a bonus to barter after a given conversation in a mod, after completing a quest to give the player a discount on his ware for a limited time.


Quest script that checks the quest stage (for whatever quest you want completed first). If that stage is completed, your quest script adds a perk that increases barter/speech. Timer counts down, then removes the perk.
User avatar
Anna Watts
 
Posts: 3476
Joined: Sat Jun 17, 2006 8:31 pm

Post » Wed Dec 30, 2009 9:08 am

Quest script that checks the quest stage (for whatever quest you want completed first). If that stage is completed, your quest script adds a perk that increases barter/speech. Timer counts down, then removes the perk.


I did that but i cannot see why the GECK wont save this loop :


while ( timer <= 20 )
{
set timer to timer + GetSecondsPassed
if timer == 20
Player.RemoveSpell AAADocZCustomPerk
endif;
}
User avatar
T. tacks Rims
 
Posts: 3447
Joined: Wed Oct 10, 2007 10:35 am

Post » Tue Dec 29, 2009 10:33 pm

I did that but i cannot see why the GECK wont save this loop :


while ( timer <= 20 )
{
set timer to timer + GetSecondsPassed
if timer == 20
Player.RemoveSpell AAADocZCustomPerk
endif;
}


"While" isn't a valid script command in FO scripting is it? I don't recall ever seeing it used. Try using "If (Timer <= 20)"
User avatar
Brandon Wilson
 
Posts: 3487
Joined: Sat Oct 13, 2007 1:31 am

Post » Wed Dec 30, 2009 10:51 am

"While" isn't a valid script command in FO scripting is it? I don't recall ever seeing it used. Try using "If (Timer <= 20)"


Same here.
But if you use the first 'if' then the next will be 'elseif'. Or you could try just closing each one off like I would.
Not to mention you need an end at the end. I have never seen brackets used either.

Try this:


If timer <= 20; same thing, but run it on a scripteffectupdate block or gamemode
set timer to timer + GetSecondsPassed
endif; closing it off

If timer >= 20; Greater than just for the heck of it.
player.removespell AAADocZCustomPerk
endif; closing it off
end; ending the block


Also, you could just do:

Begin ScriptEffectStart
player.addspell AAADocZCustomPerk; Set the effect for 20 seconds
end
User avatar
Jaki Birch
 
Posts: 3379
Joined: Fri Jan 26, 2007 3:16 am

Post » Wed Dec 30, 2009 3:51 am

Same here.
But if you use the first 'if' then the next will be 'elseif'. Or you could try just closing each one off like I would.
Not to mention you need an end at the end. I have never seen brackets used either.

Try this:


If timer <= 20; same thing, but run it on a scripteffectupdate block or gamemode
set timer to timer + GetSecondsPassed
endif; closing it off

If timer >= 20; Greater than just for the heck of it.
player.removespell AAADocZCustomPerk
endif; closing it off
end; ending the block


Also, you could just do:

Begin ScriptEffectStart
player.addspell AAADocZCustomPerk; Set the effect for 20 seconds
end


Thanks for your replies guys it help me figure it out :)
User avatar
Enny Labinjo
 
Posts: 3480
Joined: Tue Aug 01, 2006 3:04 pm


Return to Fallout: New Vegas