Jump to content

[LE] Quick Questions, Quick Answers


Recommended Posts

Hey, is there any way to resize map markers? I need to put one in a town but it needs to surround the whole settlement so it's triggered when you enter. I'm guessing you have to make a box of some sort & link it to the map marker...can anyone help?

Thanks

I've never done it. But I suspect that it would be a trigger volume box that is large enough to encompass the entire town. The box would have a script attached that would cause the map marker to become active the first time that the player enters it.

AddToMap is the function that you'd need to use within the OnTriggerEnter event.

Link to comment
Share on other sites

Spookiness going on in a basic script--hope someone can offer a tip. I've probably missed something obvious.

 

In a given cell I have, say, 3 enemies. each enemy has the same custom script attached to is that checks

if enemy1.isdead()&&enemy2.isdead()etc.

setstage

endif

 

Somehow, I can kill all enemies, but the setstage doesn't happen.

 

To troubleshoot I added a

if enemy0x.isdead()
debug.notification("x is dead")

each time any of the 3 enemies is killed.

 

If I kill 03, it says '3 is dead'.

when I kill 02, it only says '2 is dead' (should also say '3 is dead')

when I kill 01 it says '1 is dead' | '2 is dead'.

 

So it knows that 3 is dead, but when the script runs on 1,2, it somehow has forgotten that 3 is dead.

 

This sounds like a failure to fill properties on 1,2. That totally makes sense. Problem is, they're filled.

 

Any ideas ?

Edited by csbx
Link to comment
Share on other sites

Instead of trying to check for all three at once... Advance a global variable on each death and then trigger the setstage when it reaches at least 3

 

Example:

 

 

ScriptName CheckActorDeathSetStageScript Extends ObjectReference
 
GlobalVariable Property DeathVar Auto
{The Global should be starting at a value of 0.0}
 
Actor Property SelfRef Auto
{Assign actor that script is attached to}
 
Quest Property MyQuest Auto
{The quest to advance}
 
Int Property NextStage Auto
{The stage to advance to}
 
Event OnDeath(Actor akKiller)
If MyQuest.IsRunning() && MyQuest.GetStage < NextStage
  If SelfRef.IsDead()
    DeathVar.Mod(1.0)
  EndIf
  If DeathVar.GetValue() >= 3
    MyQuest.SetStage(NextStage)
  EndIf
EndIf
EndEvent

 

 

 

Link to comment
Share on other sites

Thanks for looking at this, IsharaMeradin, and for the script.

Two questions:

1) is it not better to avoid globals if possible and instead reference something that will be scrubbed from memory automatically anyway (the dead actors) ?

2) why should your script do something different from mine ? Ie. even if this solves my issue, I'm not understanding what is faulty about the basic approach I took.

Link to comment
Share on other sites

1. There is no guarantee that the dead actors will be scrubbed completely from memory. Being properties on a script can make them persistent and remain in the dead actors collection cell.

2. Your script shouldn't do anything different from mine. The only reason I suggest a global variable is that you only need to check the status of one actor at a time, the current actor.

 

Side notes:

If you apply the script to the pre-placed actor reference extend ObjectReference

If you apply the script to the actor record extend Actor

You may be able to drop the actor property for the actor or actor reference that the script is attached to by using something along the lines of: ( (Self as ObjectReference) as Actor).IsDead()

 

If you can manage to not have the actors as properties, you'll truly be able to free them from memory as they will not be made persistent. A single global variable made persistent as a property is better on memory than three NPC actors made persistent as properties.

Link to comment
Share on other sites

I'm copypasting my message from the previous page because I suspect it would've been buried if left there:

 

Does the weaponspeedmult work for creatures that use unarmed attacks as well?

I'd like to lower the attack speed of a huge creature considerably, any help would be appreciated

Link to comment
Share on other sites

 

Spookiness going on in a basic script--hope someone can offer a tip. I've probably missed something obvious.

 

In a given cell I have, say, 3 enemies. each enemy has the same custom script attached to is that checks

if enemy1.isdead()&&enemy2.isdead()etc.

setstage

endif

 

Somehow, I can kill all enemies, but the setstage doesn't happen.

 

To troubleshoot I added a

if enemy0x.isdead()

debug.notification("x is dead")

each time any of the 3 enemies is killed.

 

If I kill 03, it says '3 is dead'.

when I kill 02, it only says '2 is dead' (should also say '3 is dead')

when I kill 01 it says '1 is dead' | '2 is dead'.

 

So it knows that 3 is dead, but when the script runs on 1,2, it somehow has forgotten that 3 is dead.

 

This sounds like a failure to fill properties on 1,2. That totally makes sense. Problem is, they're filled.

 

Any ideas ?

 

 

Not sure if this is what you are trying to do but you could you could try something like this.

Place this script on the actors

Scriptname aaaaaBanditScript extends ReferenceAlias 

aaaaaquestScript myQuestScript

Event OnDeath(Actor akKiller)
	; increment dead count
	myQuestScript = GetOwningQuest() as aaaaaquestScript
	myQuestScript.IncrementDeadBandits()
endEvent
And place this script on your quest

Scriptname aaaaaquestScript extends Quest  Conditional


int Property DeadBandits  Auto  Conditional
{tracks how many bandits are killed}

int Property TotalBandits  Auto  Conditional
{how many bandits do you need to kill?}

function IncrementDeadBandits()
	DeadBandits = DeadBandits + 1
	if DeadBandits >= TotalBandits
		setStage(20); or what ever stage you want to set
	endif
endFunction
And fill the properties with the numbers you want Edited by Aragorn58
Link to comment
Share on other sites

  • Recently Browsing   0 members

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