Jump to content

Script for android programming holotapes


devinpatterson

Recommended Posts

I'v done some scripting from tutorials & examples but no original work. So I thought I'd run this by you guys and see if you had a simpler way of doing it.

 

I have androids in a project a small group and I are working on. Some of them can be companions. I want them to use holotapes to load their mental specials (Charisma, Intelligence), skills and (non-physical) skill related perks.

 

For example loading a programming tape called assassin into an addroid will give it intelligence 5, charisma 1, guns 80, sneak 70 and the professional perk. Loading a different tape called scientist will remove those specials and add Intelligence 9, charisma 5 and science 80. Any android should be able to use any programming holotape.

 

 

Originally I thought of just attaching a script to each tape much like the "Scripting for Beginners" bobby pin example.

Something like this for the assassin tape when it was added to the androids inventory;

 

 

Begin OnAdd

 

if GetContainer == android1 OR android2 OR android3 OR android4 OR android5

CLEANUP BLOCK HERE

androidX.forceav intelligence 5

androidX.forceav charisma 1

androidX.forceav guns 80

androidX.forceav sneak 70

androidX.addperk 00165aec

endif

 

I know I need to declare a variable for "androidX" and make what ever android is loading that tape the variable "androidX".

 

But what I didn't think about was the cleanup when switching new tapes. I have to have some way to remove the perks from any previous tapes before adding the new tapes specials. I don't want to have a adroidX.removeperk line for every perk the android could potentially ever have. I looked on the FOSE page hoping there might be a sort of general sort of remove all perks command but didn't find anything I could use.

 

A second point, but not nearly as important is that I thought the player might like to have the android carry it's own tapes in the androids inventory. So instead of the last tape being added to inventory becoming the programming tape, I thought it might be better to do it through dialog. Which I would guess would be a block of script determining what tapes the player has & using messages with a button for each tape. Along with a button for extracting the current tape. So if the tape is not actually going into inventory of the android I guess I would have to use a token.

 

I'm not sure what a token is or how to set it up/use it. So any info on tokens for inventory objects would be much appreciated.

 

I am hoping that someone that sees my clumsy attempt might have suggestions for a more elegant and simplistic script.

Edited by devinpatterson
Link to comment
Share on other sites

It occurs to me no one has answered my question because they fear the impending android domination of all non-synthetic life forms. There is nothing to fear, humans will always have a place in the forthcoming android empire. They can be used as high current electric resistors or perhaps as weight bearing structures for heavy equipment. Androids are your (soon to be) benevolent overlords and as such non synthetic life forms should utilize all of their resources to aid the android cause. So join the android cause by contributing much needed scripting help and have a nice day :biggrin:
Link to comment
Share on other sites

hi devin your post is not 100 percent clear but from what i understand you want the adroid to switch "personalities" when you switch the tapes.

 

1.what immediatly comes to mind is to create a perk/actor effect for each personality. then use something similar to "the lucky 8 ball script" which would remove the perk when the object is removed.as you cannot use a tape(cannot hold scripts) you have to use something else perhaps a book.

 

I found a post called "scripting help like lucky 8 ball" search for it in the mod talk forums it is quite old. probably that script will work alternatively look at the lucky eightball script from fallout 3.

Link to comment
Share on other sites

2. why don't you add the tape together with the object in 1. you can set it up with a dialogue and different options another possibility is to use an activator together with a modified gschemistrysetSCRIPT.

 

one day machines will rule us all people are wise to fear androids haven't you seen "Terminator" ;-)

Link to comment
Share on other sites

2. why don't you add the tape together with the object in 1. you can set it up with a dialogue and different options another possibility is to use an activator together with a modified gschemistrysetSCRIPT.

 

one day machines will rule us all people are wise to fear androids haven't you seen "Terminator" ;-)

 

Hmmmm I never thought of using a actor effect that would really simplify things if the effect is removed when the items is removed. I wasn't aware you couldn't attach a script to tapes, but no biggie. I'll just use the model and pip boy icon of a holo tape and the 8 ball script. Thanks for the suggestions

 

BTW tomorrow is the day skynet becomes aware (4-21-2011 Sarah conner chronicals) keep an eye on your blender :tongue:

Link to comment
Share on other sites

Here's a good link on Tokens.

 

The most important part about tokens is the non-playable flag. It is this flag that affords the token some protection against being accidentally removed by other mods or ingame scenario's such as simulators etc. (ie. RemoveAllItems, RemoveAllTypedItems will avoid it).

The link talks exclusivley about tokens being used as code vessels, but a codeless token can be just as useful by just checking for its' existence in an inventory. If you plan on adding a menu, which sounds the best approach to me, then if you follow Cipscis tutorial it leads you through the setup using a menu token.

 

What might be a good idea for the different holodisks is using Notes.

 

The player could find a misc item (that can use the holodisk nif for appearance sakes).

The code in that item would just contain some simple code...

OnAdd
 if GetHasNote ProgramNoteSniper == 0
   AddNote ProgramNoteSniper
 endif
 RemoveMe
End

 

Your menu's can use the GetHasNote conditional to hide the menu options when the note is not present.

 

There's another 'technique' that you may find handy for projects that have a lot of variables and state data.

The variable resource quest - It's a quest that never actually starts. The main script just contains some variable definitions.

So in some way it's like having your own personal Globals. If you decided that the holodisks could only be used in one android at a time, then you could use variables here to keep track of how many of each tape were owned, and how many were in use.

 

There are dozens of ways to skin a cat though :)

Link to comment
Share on other sites

Just don't waste your time on perks - perks only work on the player.

 

I don't believe so. Here is a segment of script that runs when the mother deathclaws babies are killed and the mother is enraged;

 

QJDeathclawMotherRef.AddPerk PsychoPerk

QJDeathclawMotherRef.AddPerk AdamantiumSkeleton

QJDeathclawMotherRef.AddPerk BetterCriticals

 

Its actually what gave me the idea to sort of turn it around a little on the player. A chance for the player to battle a opponent that

has abilities like him or herself.

 

Although to be fair by far the majority of perks wouldn't make sense on a npc.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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