Jump to content

Need a script? Maybe I can help.


fg109

Recommended Posts

@ArcaneSmith

 

Yes, it is a pain that you can't do something like:

 

weapon[] weaponarray = new weapon[intVar]

 

Instead, I think you'll just have to create a form array property and fill it with "None" entries. I think the max size of an array is 128 entries, but I'm not sure. So something like this:

 

Form[] Property MyArray Auto
{Set elements 0 to 127 to None by default}

 

Then check out this BethSoft thread for some array functions you can use. I don't really see the point of using a container though.

 

Example with using those functions:

 

 

  Reveal hidden contents

 

Edited by fg109
Link to comment
Share on other sites

  • Replies 272
  • Created
  • Last Reply

Top Posters In This Topic

@avenger404

 

Try changing the names of the factions so that they don't begin with numbers.

 

 

@kryptopyr

 

I don't think there's any way to reduce the delay. I'll try and think of how to use scripting to do what you wanted. The first thing I can think of so far is this:

 

 

  Reveal hidden contents

 

Edited by fg109
Link to comment
Share on other sites

Thank you! I'll try the script out and see how it does. I understand that it just may not be possible to do what I want here. The more I read about it, the less likely it sounds that the game's combat behavior can be modified in this way. Still, I think it's worth a try, and maybe I can at least get something that is an improvement over the current behavior, even if it's not ideal.

 

I think I should be able to use IsPlayerTeammate() as the follower check. Would I write this as "if (Registered) && (akTarget.IsPlayerTeammate(False))" and "elseif (!Registered) && (akTarget.IsPlayerTeammate())" ? Also, can I use the script on a Reference Alias?

Link to comment
Share on other sites

@kryptopyr

 

It would be

 

if (Registered && !IsPlayerTeammate())

 

and

 

elseif (!Registered && IsPlayerTeammate())

 

But I'm not sure if that's exactly what you want. It might be better to check for the NPC's faction rank in the CurrentFollowerFaction.

 

 

@Korodic

 

It sucks, but Papyrus doesn't support nested arrays. :(

Edited by fg109
Link to comment
Share on other sites

You mean the linked lists created by Redwood Elf? Or did you mean something like:

 

Scriptname MyArrayObjectScript extends ObjectReference

Form[] Property FormArray Auto
{128 element array}

Int Property LastElementPosition = -1 Auto
{The last non-None element in the array}

Int Property NestedArrayCount = 0 Auto
{Just how many layers of arrays do we have?}

Function AddFormToArray(Form akForm)

LastElementPosition += 1
int Position = LastElementPosition - (NestedArrayCount * 128)
Form[] TempArray = FormArray
int Count = 0
while (Count < NestedArrayCount)
	TempArray = (TempArray[127] as MyArrayObjectScript).FormArray
	Count += 1
endwhile
if (Position == 127)	;the last element in the array
	TempArray[127] = PlaceAtMe(GetBaseObject(), 1, false, true)
	NestedArrayCount += 1
	AddFormToArray(akForm)
else
	TempArray[Position] = akForm
endif

EndFunction

 

?

Link to comment
Share on other sites

Very new to modding, not totally new to writing code but still I need help. Want to make a mod that would produce different effects in combat based on the timing of a block (like stagger or disarm if you block at a certain time before getting hit), can't figure out how to do it.

 

Sorry if perhaps there was another place I should have put this instead or something like this has already been brought up, I'm new to the forums as well.

Link to comment
Share on other sites

  On 4/19/2012 at 6:16 AM, AwesomeSkyrimDude said:

Very new to modding, not totally new to writing code but still I need help. Want to make a mod that would produce different effects in combat based on the timing of a block (like stagger or disarm if you block at a certain time before getting hit), can't figure out how to do it.

 

Sorry if perhaps there was another place I should have put this instead or something like this has already been brought up, I'm new to the forums as well.

 

Well, keep in mind that Papyrus isn't exactly fast. It's not going to be much good for controlling combat. That said, you could try this:

 

 

  Reveal hidden contents

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...