Jump to content

A newbie asking a few questions about script-writing


jacobcallt

Recommended Posts

Short:

So, somewhat in order of importance to me:

 

Answered(1: What changes do I need to make my script valid? (See Long) <-- answered by Artisten + cipscis validator, + Skree000 + Ziusudra)

 

2: What are the breath functions/actor values/names?

(after I download BRUTE I could pinpoint the script for the portion

 

"::Steady Aim::" functions, by exploring their script, but they used declared variables called breath, and called no actual breath functions in game.)

 

3: What should I attach all this to, to make it feel like the player is a mutant who emits an electric bullet absborbing/slowing field? An ingestible? A piece of armor? Make it a forcefield generator instead? (I want the player to feel like it's their power though, can I make it a permanent actor effect/base effect?) I know how to create an item record and attach an effect that way, I'm not sure I know how to get my script into an effect though.

 

Answered(4: When copying an item to have multiple versions with slightly different stats, I need to use FO3 archive to unpack the .nif files, if I want the basic model/texture, yes? (Answered by Artisten, yes))

 

Answered(5: If I want Vance's Longcoat effect (Covenleadereffect) and Ranger Battle Armor Effect on the same piece of equipment, I need to create a new effects record, and just copy over the stats from both of them? (Answered by Artisten, yes))

 

Answered(6: If I want a non-standard repair list, does the GECK have pretty much every combination, or do I have to make my own repair record for that? (Answered by Artisten, yes, use a form list, drag and drop objects onto it, that's so cool and simple!))

 

Answered(7: What would be the name of some animation files of various 'magic effect' looking spherical explosions? I don't mind if it looks like I'm continuously pulsing or exploding by playing the animation repeatedly, eventually I could learn to modify the frames, but for example, if I open up the fallout 3 master esm, in FO3 archive, what will I be looking for to extract the pulse grenade effect? Something like PulseGrenadeAoESphere_00.nif ? (Answered by Artisten, if you like it, use Player.PlaceAtMe explosion004 or some such))

 

Long:

 

Hi all,

 

I've done a fair amount of programming in the past, and some macro script writing for video games for myself, but since I've never done anything for Fallout or Oblivion before, I tried taking one of the example scripts on the bethesda GECK wiki, and modifying it to suit my purposes. I've 'commented out' some things that aren't clear to me, and was wondering if anyone could either clarify if they will work, if there's a better way to do it, and so on?

 

I'm trying to create an effect that will play the pulse-grenade spherical field, add damage resist, slow my movement speed, and use my 'breath' as if I were underwater. I have no idea what the actor value or variable name for breath is, and I may just have it increase rads, or decrease AP instead, or fatigue.

 

I also have no idea how to get it to trigger an animation, but I do think I know that I need FO3 archive to unpack the animation from the BSA, to include with my esm, even though it's already part of the master. I think.

 

I have the full game, and all expansions, but don't have any of the DLC installed, because I wanted to play through once, first, the entire base game as it was intended before expansions, and I have no mods installed, so I've got a clean slate as far as that goes, but I dinked around, and have been able to change things via console command, and been able to load and unload the tutorial vault 74, from the official G.E.C.K. tutorial.

 

I would like it to either drain a percentage of AP per second, giving them no more than say 15 seconds of blocking, or drain their breath at the normal rate as if they had 5 endurance, or, damage their AP a set amount each time they get hit, or, damage their AP 85% of the damage they took. I know how to modify AP, and do conditions based on the AP, but I don't know how to make it count down and degenerate at a steady pace, (can I just set the fActionPointsRestoreRate to a negative number?) If i set that value to a negative, will it kick in right away? Will it work at all? I also have no idea how to detect 'onhit' I may have to find the FOSE forums.

 

I really really want to do it with breath, since that's so underused in the game, but I have no idea how to do it, and I can kinda figure out how to do it with AP. Is the Fatigue functionality from ES in FO3? Is that what we use for breath? I know we do 'fatigue damage' barehanded, but other than that?

 

Otherwise, I'd use a nested if statement, to try to find out when the player actor gets hit, and then subtract some AP value, based on a percentage of the AP, to allow the character to only block a couple of times.

 

Also, when I do get the script correct... where do I put it? What do I do with it? Just put it in an item effects record, and attach it to an item? I've seen some people use ingestibles. Should I make an item record, attach the effect to the item, and make some way that the ingestible replenishes itself at the end of the script? Or is there a checkbox in GECK that allows me to turn on/off infinite uses of an ingestible?

 

 

This is what I've done so far in terms of attempting to write the script for my 'forceshield block'

 

 

 

; I could try to make it imitate Champions Online completely, by making it a percentage mod, player.modav DamageResist, 300 instead, tripling ;whatever DR the player has (maybe it should be player.modav DamageResist, 3 ... not sure)

 

taking a stab at the code, with edits thanks to suggestions by Artisten:

 

 

ScriptName HotkeyBlock

Short sblock; hotkey functionality
Short permresist; Player resist at the time of script activation
Short currapvalue; used to refer to the max AP
float timesincelshift; timer functionality
float timer; one second timer to trigger during each of the 15 seconds.

int apdamagerate; used to balance based on any mods to AP Regen
int innit


Begin GameMode

Set permresist to Player.GetAV DamageResist; Player resist at the time of script activation
Set currapvalue to Player.GetAV ActionPoints
; allows me to perform functions on a variable, rather than on the function,
; or the actor value directly, so I can possibly drop the code

if currapvalue > 59
; used to balance based on any mods to AP Regen
	set apdamagerate to getGS fActionPointsRestoreRate
	set apdamagerate to apdamagerate + 4
elseif currapvalue < 60
	set apdamagerate to currapvalue/15
endif

; script, if iskeypressed left shift

if IsKeyPressed 42 != sblock
	set sblock to sblock == 0
	if sblock;Button pressed

; Do things when button 'left shift' is pressed,
; in this case, improve damage resist at the cost of AP
		if innit == 0

;set the timer value, count up to 15 seconds
			set timesincelshift to 0

;Make sure we only set up the timer once!
			set innit to 1

;start at the beginning of  the timer here

			Player.SetAV DamageResist, 85
			PlayMagicEffectVisuals (ID of pulse grenade sphere), 15
			Player.SetAV MoveMult, .6; Trying out movemult instead of fMoveBaseSpeed
			Player.DamageAV LeftMobilityCondition, 1
;  to get instaneous movespeed changes, I needed to damage mobility
			Player.RestoreAV LeftMobilityCondition 1
; after  damaging mobility, heal it up
;timesincelshift set, begin timing
		else

; mini timer to do damage each second.

			if timesincelshift < 16
				set timesincelshift to timesincelshift + getSecondsPassed

				if (timer >= 1)
					set timer to 0
					Player.DamageAV ActionPoints, apdamagerate
				else
					set timer to timer + GetSecondsPassed
				endif


	; ... or no, the time is up!
	;code to execute after 15 seconds
				if currapvalue < 3 || timesincelshift > 15
		; I think the double pipes is the or command, but I'm not sure if that applies in FO3 programming, or even in FOSE. Regardless, this checks if they should no longer be able to block. I'd really rather replace AP with breath.

					GOTO normalstats;  send to label normalstats
				endif
			endif
		endif

; later try breath instead of AP

	else; Button released

; Do things when button 'left shift' is released,
; in this case, reset the damage resist, run speed, breath(AP until I figure out breath or fatigue)
		set innit to 0; so that next time the script runs the timer will fire again.
		GOTO normalstats; I want to make the following modular, so that I can kick the player back to normal stats at any time, without a lot of redundant code.



	endif
endif



label normalstats
; after condition ends:
Player.SetAV DamageResist, permresist
Player.SetAV MoveMult, 1
Player.DamageAV LeftMobilityCondition, 1
Player.RestoreAV LeftMobilityCondition 1


End

 

Also:

 

I was trying to create a duplicate of the Brotherhood of Steel scribe's robe, with Vance's longcoat stats + Ranger BattleArmor stats, and succeeded, now my roommate wants the thing to be blue... so now I get to use some of the nifskope tutorials. <-- previous questions here were answered by Artisten on Bethesda GECK forums

Link to comment
Share on other sites

some really interesting script ideas here... one thing if you havent already found is Cipsis's Fallout script checker/validator (sorry Cipsis if i spelled your name wrong =(

Also grab the Notepad++ geckscript plugin!!! its the only way to write scripts, it will auto-format them and even color code them :)

Link to comment
Share on other sites

Thank you both! :)

 

Notepad ++ Is indeed totally awesome, and now I wonder how I ever got by doing html, java, or GECK, in a regular notepad/wordpad o.0 Thanks Skree!

 

My only questions now are basically answerable if I spend some time in the GECK, but I've been really busy lately, but they are:

 

Breath effects, anyone?

 

Where do I paste my script in the geck, to save it as a new object effect? I know how to make an object effect set to apparel, so that I can select it for a piece of gear later.

 

Thanks for everyone's help thus far!

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...