Jump to content


Photo

Which actions set a target?


  • Please log in to reply
4 replies to this topic

#1 temnix

temnix
  • Member
  • 983 posts

Posted 12 November 2016 - 01:50 PM

There are ways to pick a creature inside a script of another: going through Nearest, SecondNearest etc., or using shouts and then LastHeardBy, naturally, LastSeenBy as well. Once that creature is caught in the sights, however, some way of fixing it there is required. LastSeenBy and LastHeardBy only hold for one script run - the former can change in the next run and the shout fades in any event. Distances can change, too, so Nearest etc. are not reliable to maintain a lock on the same creature. What is reliable is getting the scripted creature to target the object with some action and then using LastTargetedBy(Myself). Actions, at least, we can completely control, so we can always decide who will remain that last target, round after round, so we can perform other actions on and with the second creature. But some kind of "service targeted action" is required first to give the LastTargetedBy its object. This service action need not by itself do anything, only provide the target.

 

The simplest "service action" is AttackOneRound(), but attacking starts combat, prevents saving, gets the fighting music to play and may actually be dangerous. For the mod that I'm making I'm looking for another action, as unobtrusive as possible, preferably one that will have no observable effect at all. I tried a couple from the G3 guide which are said not to work, like BackStab, but they don't work in every way, so they don't even set the target. PickPockets? That might actually succeed if the script is used for a thief, and that would be inconvenient. What else?

 

 



#2 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5150 posts

Posted 12 November 2016 - 02:42 PM

Erhm, why the cheese do you need to maintain a target ?
See the scripts are run ~15 times per second, that means that yes the targets can change ... but so cheese what ? It doesn't actually matter that much. As when you pick a target, you can assume that if the action that you did either takes long enough to for it to be the next round or how ever long it takes to get the action done or it doesn't and you can re-estimate what to do next, as you would if it took the round to be done.
Now then, if you want for this to be for the invisible creature... why not just do all the things that need to be done one go ?
 
What's the case here ? What are you exactly trying to do ? Yeah, you try to make a marker.. BUT WHY ! It would be good to usually mention this fact in the very first post in every thread you make !! For that, I'll this time call you just an idiot. Next time, I'll promise this to be more funny, if you don't correct your action..
 
A bad but still medianly way to do this can be... you pick a stat that you alter to be your marker, and then use that to launch the commands... but try not to mess them too badly.
Aka you make an invisible creature, and make your marker to be an effect in a spell. Then you cast that spell with:
ForceSpellRES(S:RES*, O:Target)
 
And then you use the made marker to do the further actions... and then command the target with the invisible creature for example, using the marker. But you could just cast a spell that has multiple delayed effects to do most of those things. Yeah, I can't see inside your mind to tell what the exact details are... but this goes to assuming on things, but most things can be set this way without even the need to make the invisible creature .. or maybe there could be numbers of summoned invisible creatures(with different .cre's) and the spells target is then targeted creatures via the LastSummonerOf(Myself) with different horrible commands / or spells/effects. Yes, the .cre's just do one action and then kill themselves, in two script IF THEN END -phases.

Edited by The Imp, 12 November 2016 - 02:45 PM.

Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#3 temnix

temnix
  • Member
  • 983 posts

Posted 13 November 2016 - 02:15 PM

Imp, you're lagging behind by a few months. I've long since discovered how to mark a creature. Get a RAM upgrade and start reading the question instead of unloading a jumble of irrelevant information. I ask how to maintain a lock on a creature through LastTargetedBy(), so share your thoughts if you have an idea or hold your peace. You must assume I have a reason for asking the question the way I do, no? I'm not going to explain the long and winding way by which I arrived at it. Yes, it's possible to e.g. assign a spell state to a creature, or go through LastSummonerOf(), and so on, these options have been mentioned again and again. Obviously they are all lacking in different ways, which you can discover for yourself if you do as much testing as I have done, in every imaginable circumstance.

 

I'll repeat the question for those who have something useful to say: how can a scripted creature get another creature for LastTargetedBy(Myself)?



#4 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5150 posts

Posted 14 November 2016 - 02:03 AM

Again, I'll tell you, what exactly are you going to do ?
Say like, I'll cast a "lower resistance" spell to target x, then I'll cast fireball spell on them, and then ... plah plah plah. Or is it something more specific... for example, you want to cast charm on them, then after a while, stun them, and then after that release them.
??
I do not see any reason other than those to restrict the target to a specific creature... and like I implied, they can be done with the ways you should know to do them.

I wonder if you even know a scenario you are asking about ? RAM upgrade ... hih. I wonder if..
Obviously they are all lacking in different ways, which you can discover for yourself if you do as much testing as I have done, in every imaginable circumstance.
Just give me one ? That's all I ask.
RAM upgrade...

Edited by The Imp, 14 November 2016 - 02:04 AM.

Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#5 temnix

temnix
  • Member
  • 983 posts

Posted 15 November 2016 - 06:48 AM

Look... The different ways of marking creatures have their own uses, but also limitations.

 

LastHeardBy() only lasts one script run, and the the "sound" fades, so the next time the script runs there will be no object for it at all.

 

LastSeenBy() by itself or in combination with a custom spell state (the easiest and safest marker to put on a creature) works correctly for one script run, but it fails in a crowd of creatures.

 

Nearest, SecondNearest etc. constantly change with distance and are also unreliable.

 

LastSummonerOf() only works for summoned creatures.

 

I'm writing regular scripts for regular creatures. I know how to control their AI, but now I need actual scripts that will provide fast and secure targeting in a crowd. I have had to start many topics and ask around a lot, and a few people have actually been helpful, so I have worked out a combo that does that: LastHeardBy + a custom state to hang later targeting on. I make the target shout with ActionOverride. Unlike vision, hearing is not confused by the number of creatures nearby and doesn't wander from one to the next, it is instantaneous. But I can't make the target shout every round, so the challenge now is to convert the initial targeting by sound into more secure forms for the following script runs. The most secure form of targeting is LastTargetedBy() itself. I have been able to use local variables in the scripts to combine the two methods: first-run targeting with LastHeardBy() sets a local, a block higher up triggered by that local uses LastTargetedBy() + the custom state to make sure it is the right creature.

 

This works quite well for most cases, where I can distinguish the target with a custom state. But to expand the system I would like an even more direct way of fixing the target so that all further actions follow up on the same creature. That's why I'm looking for some interim useless action that can be instantaneously performed on the shouting target. That action needs only to target the shouter, and the script from that point onwards should reliably deliver the actions to LastTargetedBy(). I tried ApplySpellRES with a dud spell, but this action does not seem to leave the target "targeted," since it comes from the engine, not the creature whose script calls for it. I tried ReallyForceSpellRES, but again the target is not "targeted," as I expected. So now I ask for advice from modders who have tried the "defunct" and Not-Tested actions from the G3 Guide - ones that might not produce any outward results but might count as targeted actions to the engine.

 

Is this a full enough exposition for you? Detailed enough for a Bond villain's monologue, I think.


Edited by temnix, 15 November 2016 - 06:51 AM.