Skip to content

What do you know, creatures can rest too

chimericchimeric Member Posts: 1,163
Putting Rest() in a creature's script refreshes its spells.

That's news to me.

I'm thinking how to use that for my ally control mod. Here is an idea: whenever the party rests, its allies on the current map rest too. This should make use of the PartyRested() trigger, but where to put it? In baldur.bcs? I've never edited that one yet. I suppose there are two ways to do this: something overarching that always applies, like baldur.bcs, which would then pass the Rest() command to creatures of the GOODBUTBLUE allegiance... a few uncertainties about this one... or an Everyone-targeted spell (again from baldur.bcs, I suppose) with some filters that spawns an invisible for every ally, and the invisible then does an ActionOverride(Nearest,Rest()) on a custom spell state. I've used this method before, but never on such a potentially wide scale.

The Siege of Dragonspear has crowds of allies in some places, from what I've read, so a spell may challenge the performance something fierce. Both ways seem possible, but a script action is more promising... Any ideas? I would just try an ActionOverride to everybody of the right allegiance, but allegiance isn't a parameter for [ANYONE]. But PC is, yes?

Hmm. The second-simplest way I can think of is putting this in baldur.bcs:

IF

PartyRested()

THEN

RESPONSE #100

ActionOverride(Protagonist,GlobalShout(12))

END

IF

Heard([ANYONE],12)

THEN

RESPONSE #100

Rest()

END
But how to exclude the party? Allegiance is not a creature's property that's tracked, but whether it's a PC or an NPC is, yes? Instead of Protagonist I can put an any-not-PC filter and then just command the creatures directly without bothering with shouts. It's all the same whether creatures on the map are allies or not, really. If the party has managed to rest, they can be assumed to have recuperated too.

I can use a suggestion how to pass that Rest() command directly to not-PC creatures, from better code writers than myself.

P.S. By the way, the description of PartyRested() on G3 says it works if the party has just finished resting. How recently does it have to be? Post-morning wood, pre-tooth brush? :p

Comments

  • ArdanisArdanis Member Posts: 1,736
    edited October 2016
    Opcode 316 makes the target rested, so one global spell aimed at GOODBUTBLUE (via 177) should be enough.

    I would just try an ActionOverride to everybody of the right allegiance, but allegiance isn't a parameter for [ANYONE]. But PC is, yes?

    Not sure if I understand correctly... You can specify [GOODBUTBLUE], or [PC], or [GOODCUTOFF] to match both players and their allies, etc. Whatever EA.IDS supports, really.
  • chimericchimeric Member Posts: 1,163
    edited October 2016
    So Goodbutblue goes as EA, not as Allegiance. I expected it a separate field, like Alignment. But you're right, it's just an EA entry. Shows how new I still am to this. I want to try doing this without a spell, though, directly from baldur.bcs. Is there any way to cover all objects in the area? No, I suppose not. Gah, why don't they have an Everyone object?
  • chimericchimeric Member Posts: 1,163
    edited October 2016
    Okay, I withdraw the complaint. [ANYONE] works as Everyone. I still have to get the hang of this... Now, baldur.bcs is the script run by the engine itself, yes? I don't need to have any creature run my actions. So what if I add this bit to baldur:
    
    IF
    
    PartyRested()
    
    THEN
    
    RESPONSE #100
    
    Kill([GOODBUTBLUE])
    
    END
    ?

    Death as a metaphor of sleep.

    Edit: Okay, I tried it and it doesn't work without an added bit - ActionOverride to some creature who then does the killing... eh, the resting of allies. I put Protagonist in there, but it's not very attractive when he strains after he is passed the order. This kind of straining after every camp... not aesthetically pleasing. In addition, if an action has to be sent through a creature, if the engine can't order actions directly, doesn't that mean I would have to use an actor to cast that Everyone-targeted spell as you suggested, Ardanis? Who is going to do Cast()?

    Are there ways around this? If I absolutely must do either the spell or the script action through ActionOverride, then at least I don't want to see my characters convulse in such an unappealing manner. Things need to happen behind the scene as much as possible. What about objects like MostPowerfulOf? Do you know how they are used? If I spawn an invisible with 50 levels in a class and make him issue the call to bed...
    Post edited by chimeric on
  • ArdanisArdanis Member Posts: 1,736
    It may force one good but blue actor to rest. Or may not, since non-static objects are only returned when they can be seen by the script owner, and since baldur.bcs isn't a creature's script...

    I'd try to ApplySpellRES("xxxx",Player1) instead of Rest(), xxxx targeting good but blues with opcode 318.
  • chimericchimeric Member Posts: 1,163
    edited October 2016
    Here is what I've come up with for after PartyRested():

    ActionOverride(WeakestOf([ANYONE]),Kill([GOODBUTBLUE])

    There is always a weakest on a map, and hopefully it's not one of the PCs, so this should mostly do away with the straining, especially as the party levels up. If there is no one left but the PCs, then the weakest PC will do it. If there is only the Protagonist remaining, then he's the weakest of all. A kind of reversed Highlander, if you will. :)

    This command works out of baldur, so I feel that I'm on the right path. The difference between Kill() and Rest(), though, is that Rest() doesn't accept objects, so it has to be passed on to GOODBUTBLUE creatures, and then they'll rest themselves. And strain before they do... Anyway, it's impossible to put one ActionOverride inside of another, so this weakest dude, wherever he is on the map exactly... :p This weakest guy or gal, I say, I may just use to issue a Global Shout, and then those who hear it... The rest is yet foggy. If you have suggestions about doing it from the script, I'm all ears.

    It's awfully late here. Tomorrow. Stay tuned for more mad science from Chimeric, everyone! Or is this art? Something in between, I guess.

    Perhaps my best option is a combination of Weakest and your resting spell. A tasloi somewhere doing a quick cast, yes, that may be inconspicuous enough.
  • chimericchimeric Member Posts: 1,163
    edited October 2016
    Doesn't ApplySpellRES require a creature to do this action? It has been my experience with the other stuff I've put in baldur.bcs.

    Anyway, what I have right now, after your suggestion, is this:
    IF
    	PartyRested()
    	
    THEN
    	RESPONSE #100
    		
    ActionOverride(WeakestOf([ANYONE]),ApplySpellRES("C&CRES_#",Myself))
    
    END
    Seems to work. And thanks for ApplySpellRES, I've used ReallyForceSpellRES everywhere so far. They work the same way, yes, except the Apply doesn't wave hands? That's very good for making things look more natural.
  • ArdanisArdanis Member Posts: 1,736
    Doesn't ApplySpellRES require a creature to do this action?

    Contrary to what one might expect, no.

    They work the same way, yes, except the Apply doesn't wave hands?

    Sort of. It's like ReallyForceSpell() done by the "game" rather than particular creature.
  • chimericchimeric Member Posts: 1,163
    Well, in that case that's much better than what I wrote. I'll do that. Wait, how does Apply find objects? Who would be Nearest, if it's the game that does it?
  • ArdanisArdanis Member Posts: 1,736
    If you use global filtering within SPL, you won't need specific objects and can apply it to Player1 (who's guaranteed to be present in the area), it works all the same.
  • chimericchimeric Member Posts: 1,163
    That's what I did. Thanks.
Sign In or Register to comment.