Jump to content

Creatures not responding to ActionOverride()


ItchyDani3l

Recommended Posts

Hey I've been having this problem.

It only seems to happen to certain creatures, like SAREV1.CRE and TETHTO.CRE. (Armored Figure and Tethoril).

 

I don't see anything in their scripts that might hake this happen (like a NoAction() block), but they just seem to not care about any of the things my scripts tell them to do.

 

I'm scripting in the BGEE build of IE. This is the particular code block that is not working.

        CreateCreatureObjectOffset("SAREV1",Player1,[345.300])
        CreateCreatureObjectOffset("OGRE04",Player1,[375.345])
        CreateCreatureObjectOffset("TAMOKO2",Player1,[300.345])            // use DisplayStringHead()
        CreateCreatureObjectOffset("OGRE03",Player1,[345.375])
        CreateCreatureObjectOffset("IRONELIT",Player1,[400.345])
        CreateCreatureObjectOffset("IRONELIT",Player1,[345.400])
        ActionOverride("SAREV1",ChangeAIScript("WTASIGHT",CLASS))
        ActionOverride("SAREV1",MoveToObject(Player1))
        ActionOverride("OGRE04",MoveToObject(Player1))
        ActionOverride("TAMOKO2",MoveToObject(Player1))
        ActionOverride("OGRE03",MoveToObject(Player1))
        ActionOverride("IRONELIT",MoveToObject(Player1))
        ActionOverride("IRONELIT",MoveToObject(Player1))

It seems that the ENTIRE block gets frozen at the 7th or so line, as nobody moves when told to.

 

Basically, this script is supposed to simulate the fight at the beginning of baldur's gate, where the player can fight Sarevok's party he had at that time. The problem is that Sarevok is causing nobody to move, and also his script is not changing.

Link to comment

In which script are you running this at ?
It would be better if you would order the just created characters to act in the next block, not in the same one as you created them in...
... and are you sure they can know where the player is, as they are created off the screen.... they would have to have vision range, and for that, a lots of effects with opcode 262.

Link to comment

For creation, you take the cre name.

 

For script actions, you need the script name (formerly called death variable). For the "SAREV1.cre" this would be "Sarevok", for example.

 

Thus, this should work:

 

CreateCreatureObjectOffset("SAREV1",Player1,[345.300])

ActionOverride("Sarevok",ChangeAIScript("WTASIGHT",CLASS))

ActionOverride("Sarevok",MoveToObject(Player1))

 

The others accordingly.

Link to comment

In which script are you running this at ?

It would be better if you would order the just created characters to act in the next block, not in the same one as you created them in...

... and are you sure they can know where the player is, as they are created off the screen.... they would have to have vision range, and for that, a lots of effects with opcode 262.

 

It was operating at CLASS level.

Yeah I didn't think about the whole line of sight thing. I wasn't sure if they needed to be able to see the target.

 

 

For creation, you take the cre name.

 

For script actions, you need the script name (formerly called death variable). For the "SAREV1.cre" this would be "Sarevok", for example.

 

Thus, this should work:

 

CreateCreatureObjectOffset("SAREV1",Player1,[345.300])

ActionOverride("Sarevok",ChangeAIScript("WTASIGHT",CLASS))

ActionOverride("Sarevok",MoveToObject(Player1))

 

The others accordingly.

 

From what i understand, both should work right? I haven't tried your syntax yet but I'll certainly give it a shot.

 

Also, assuming you're right, why would this only be happening for these certain creatures and not others?

 

Also, multiple creatures often share the same death variable (or so it seems). How would I go about differentiating between these duplicates?

Link to comment
From what i understand, both should work right?

 

If you mean both cre-file name and script name: No, for script actions only the script name is relevant (it's, like, what the name says). For spawning the creature it's the cre-file name. Once the creature is spawned, it's controlled by the script name, nothing else.

This also means: creatures without an assigned script name cannot be given actions by other scripts than their own, and (concerning your last question): Creatures sharing the same script name is a bad thing if you want to control them by their script name. Only the first creature performs it, the others won't, even for a command like DestroySelf(). Every creature needs a unique script name if you want it to react to commands using their script name (you can still control them all by assigning a script to them, of course).

 

Also, assuming you're right, why would this only be happening for these certain creatures and not others?

 

Because some creatures have their cre-file name assigned as script names, it is common for the less important ones, but others, like SAREV1.cre, have their real names. If you take a look at the cre-files you'll see it. What I am telling you are not wild guesses, btw. It's knowledge, and I'd rather you to try it out before posting more posts with hypothetical questions.

 

And also: MoveToObject(Player1) works across the whole area, if need be. Line of sight is no restriction. It would be for e.g. Detect(Player1), though.

Also, ordering the cres around in the same script block as they were spawned in is no problem. It's done in most spawning scripts in the game.

Link to comment

 

 

Also, multiple creatures often share the same death variable (or so it seems). How would I go about differentiating between these duplicates?

 

Well, for creatures like Sarevok, you'll only have one of the cres with that death variable on screen at a time, so it doesn't become a problem.

 

If you're talking about using ActionOverride on a group of creatures with the same DV - say the rats in Reevor's storehouse, that's a bit trickier. (The behaviour I observed for a BGT install was that only one of the creatures with the same DV would respond to the override. I got around that by giving them all a script that would respond to an Area-specific global. It worked, but is a clunky way of doing things.)

Link to comment

If you mean both cre-file name and script name: No, for script actions only the script name is relevant (it's, like, what the name says). For spawning the creature it's the cre-file name. Once the creature is spawned, it's controlled by the script name, nothing else.

This also means: creatures without an assigned script name cannot be given actions by other scripts than their own, and (concerning your last question): Creatures sharing the same script name is a bad thing if you want to control them by their script name. Only the first creature performs it, the others won't, even for a command like DestroySelf(). Every creature needs a unique script name if you want it to react to commands using their script name (you can still control them all by assigning a script to them, of course).

 

Thanks so much for your help jastey.

 

So then there's not much I can do about creatures without death variables short of changing their scripts outside of the game then huh?

 

I'm glad you guys could help, everything is working much smoother now.

Link to comment

So then there's not much I can do about creatures without death variables short of changing their scripts outside of the game then huh?

Well, you can do what you wish with the creatures you create ... as in, you can copy one of the already existing creatures, and assign the copy to be a new .cre file, then add the death variable(as in the script name), and then use your own creature during the scene you make.

 

As in, tp2 code:

COPY_EXISTING ~sarev1.cre~        ~override/xy#humd.cre~  //humpdebumdi's cre file
WRITE_ASCII ~0x0248~ ~xy#humo~ // his override script
WRITE_ASCII ~0x0280~ ~xy#humo~ // and the death variable 
The "xy" in front of the file is meant to be your personal prefix...

And then use those in the script you compile before that, .baf code:

        CreateCreatureObjectOffset("xy#humd",Player1,[345.300])
        ActionOverride("xy#humo",ChangeAIScript("WTASIGHT",CLASS))
        ActionOverride("xy#humo",MoveToObject(Player1)) 
Link to comment

(Only it should be

CreateCreatureObjectOffset("xy#humd",Player1,[345.300])

in your example because that's the name of your example cre-file.)

 

-And I would always name cre-file, override script, dialogue and script name of one creature the same, btw.

 

Everyone modding IE games is adviced to register an own prefix (and not use another's), yes.

Link to comment

After the sixth thousand edits, I think I got the code correctly, now... so the script name and death variable and override script's name is the same and the cre files name is the summon name.

Yeah, you got a point in that they should be all the same, but well whatever.

Link to comment

Creating my own creatures is really beyond the scope of my "project," if you can even call it that. It's more of a hobby.

 

My reason for writing the scripts is for them to be shared in multiplayer games with others who have vanilla clients.

 

I'm glad that I learned that the death variable is the actual name that needs to be referenced, so I can easily find out via NI which creatures will be useful to me and which ones will be unable to be controlled.

 

I'm actually really intent on using that particular set of creatures I referrenced. (TAMOKO2.cre, SAREV1.cre, IRONELIT.cre)

The ogres are a non-issue I think because they all have death variables. Actually I'm pretty sure I didn't even get the same ogres as are in the cutscene, but I'll work on that.

 

The problem is that IRONELIT (the Black Talon Elites that accompany sarevok, as well as in the rest of the game) doesn't have a death variable.

I think if I find another way of targetting them, I'll be able to set a script for them that can control them and tell them what to do.

 

My idea right now is to do something like this:

ActionOverride("OGRE03",ActionOverride(Nearest(Human),ChangeAIScript("whatever",OVERRIDE)))
ActionOverride("OGRE04",ActionOverride(Nearest(Human),ChangeAIScript("whatever",OVERRIDE)))

If I recall correctly, you can stack like up to a depth of 5.

If I position the IRONELIT's correctly, this should work right?

Of course the problem with this is that there are many creatures which fit this description.

 

Does anyone else have any ideas on how to target these particular creatures OR similar creatures with no death variables?

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...