Factions

Everything about development and the OpenMW source code.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Factions

Post by Zini »

Nope. Completely wrong. You can get a Ptr to any MW-reference in any cell at any time (cells are silently loaded on demand, if needed).
User avatar
gus
Posts: 390
Joined: 11 Aug 2011, 15:41

Re: Factions

Post by gus »

Nice!

I've added the script instruction. You can now do funny stuff like player->ForceGreeting :lol: (if we want to do an easter egg, we could add funny dialogues to the player :p)

But i'm not sure: i think the only valide syntax is "whateverNPC->ForceGreeting" (having simply "ForceGreeting" seems...strange) so i put -1 for the opcode of the implicitReference, but i'm not sure it's the right way.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Factions

Post by Zini »

That is not correct. ForceGreeting is perfectly valid. We are using it a lot in Redemption.

Edit: fixed

Edit2: In case anyone is interested, the recent scripting additions bring us up to 37.4% of all non-dialgoue scripts in Morrowind.esm being compiled correctly. The number looks still a bit low-ish because there is a small number of really commonly used script instructions that have not been implemented yet.
User avatar
gus
Posts: 390
Joined: 11 Aug 2011, 15:41

Re: Factions

Post by gus »

Great!

But to be fair, i'm not sure I understand exactly what explicit and implicit mean.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Factions

Post by Zini »

We are talking here about instructions that work on a MW-reference.

You can explicitly specify a reference by using the -> syntax.

Or you can implicitly specify a reference (i.e. not mentioning it at all in the script), when the script the instruction belongs to is associated with a MW-reference (that is true for local scripts).

Example: You want to initiate a dialogue for NPC A.

You can do that from any script with

A -> ForceGreeting

Or you can do it from the NPC's script (or a dialogue script for this NPC) with:

ForceGreeting

Another difference is, that the former case may not result in what you expected, if there is more than one reference for NPC A, while the second once is guaranteed to work with the right reference, because scripts are actually not attached to IDs, but to references.
User avatar
gus
Posts: 390
Joined: 11 Aug 2011, 15:41

Re: Factions

Post by gus »

Thanks! That's a lot more clear now! Maybe I can copy-past that somewhere in the wiki?
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Factions

Post by Zini »

If you want.
Post Reply