Jump to content

Recommended Posts

Posted (edited)

@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
  • Replies 272
  • Created
  • Last Reply

Top Posters In This Topic

Posted (edited)

@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
Posted

That was really helpful! Also I should had found that post myself, don't know how I missed it! =X

 

Hopefully I'll be able to make something out of it. If you need anything I can help with, feel free to pm me

 

Many thanks!

Posted

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?

Posted (edited)

@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
Posted
  On 4/19/2012 at 4:32 AM, fg109 said:

@Korodic

 

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

 

there is a way to fake it.

Posted

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

 

?

Posted

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.

Posted
  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

 

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

    • No registered users viewing this page.

×
×
  • Create New...