• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

PA course on C

<!--quoteo(post=144248:date=Apr 1 2006, 12:45 PM:name=CouchcaptainCharles)--><div class='quotetop'>QUOTE(CouchcaptainCharles @ Apr 1 2006, 12:45 PM) [snapback]144248[/snapback]</div><div class='quotemain'><!--quotec-->
.....
HTH <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
<!--QuoteEnd--></div><!--QuoteEEnd-->


Yes, sure it will help, by Jove !!!!

Thx <img src="style_emoticons/<#EMO_DIR#>/bow.gif" style="vertical-align:middle" emoid=":bow" border="0" alt="bow.gif" />
 
NathanKell waves @ CCC. <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />

To expand a bit on CCC's posts:

First--I don't know how much about programming in general, or other languages, you know, kblack...I'm going to explain this in terms of C.

Regarding variables in general: POTC's script uses typed variables. So if you want to declare a variable, you must declared it of a certain type, i.e.
bool checkedgoodsails = 0;

Not including the type will result in a syntax error. (However, once declared, you may, and indeed must, use only the variable's name.)
But I'm sure you already know this; this was just in light of the abbreviated form you used in your posts. <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />

Regarding scope (global/local etc.):

When you launch Engine.exe, the script engine loads the file program\seadogs.c, and that's it. Any other files must be #included (or added via loadsegment(), see below).

Any variables defined in any of those files--out 'in the open' that is, rather than inside functions--will be accessible anywhere in the code.
For example, most of the 'core' objects--Ships[], Characters[], etc., are declared in globals.c. However, they have handler functions that we normally use rather than referencing the objects directly.

So if you declare a variable outside of a function, and in an #included file, it is indeed a global and will work anywhere.

If you declare a global inside a file that is not included but loaded via a loadsegment() call, it will only exist while that segment is loaded (and be no longer accessible once you unloadsegment().) {fn1}

Objects are a special type of variable, one to which you can add attributes. If the object is a global, then the attribute is a global; if the object is a local variable, then the object and any attributes it contains will only be accessible within the function that creates it (and the object and all its attributes will be destroyed when the function exits).

Attributes are definitely not variables in themselves, and thus have no existence or meaning outside the objects to which they are attached.

Attributes are hierarchical, i.e. you can make trees of them. However--and this is a big caveat--they are handled internally as a list only--so the time to check, set, or otherwise deal with an attribute goes up based on the total number of attributes the object contains, not the number in the current level of the tree (let alone the expected "no penalty" since you tell the program exactly which attribute to access). And moreover, you pay the performance penalty for the total number of attributes the object contains -any- time you access -anything- in the object.
Example (and kudos to Inez, who figured this out and fixed it): the worldmap grid used in Fleets. Originally done as an attribute tree, later redone as an array.
The advantage of attributes for array-like tasks is that you can resize or otherwise manipulate the array at any time, and have as many dimensions as you want.


{fn1} I believe this is so, but I am not 100% sure--the variable may persist. Certainly extern declarations persist outside the segment in which they are declared. We should check this.
--------
And lastly, two slight clarifications to CCC's explanations:
(And a note)
Zeroeth: the note, regarding my old post on globals vs. attributes. At one time I was under the impression that adding (or removing) globals broke the ability to load and resave games (when the loaded game didn't have the variable). Scheffnow taught us otherwise. :]
To this day I have not much of a clue -what- makes 'upgrading' saves unstable--clearly adding too many variables can sometimes cause corruption or a crash on save; but there's no hard and fast rule.
So yeah, the simple answer is using attributes attached to a global object rather than adding global variables is more save-friendly--but per above using attributes has a performance penalty.
Plus this only makes a difference to code changes that occur after a game was saved; starting a new game avoids the 'trouble adding/removing globals' issue completely.

So I would say, if what you want to do can be done better with a global variable than 'piggybacking' a new attribute onto something (the object ShipLookupTable is the usual one to use. :] But it got kinda full. ), don't hesitate to use one. A bool here or there almost certainly won't make a difference.

First: preprocessor defines vs. global variables.
This:
#define SOMETHING x
is called a preprocessor define, and it works (in NORMAL environments) very simply: whenever the compiler sees SOMETHING in the code, it substitutes x in its place.
So if we define FIRSTNAME as "Nathaniel", then every time there FIRSTNAME appears in the code it gets changed to "Nathaniel".
POTC handles things slightly differently. First of all there's no compiler, of course. But the big change is you can only use a string or a number as the value. So something like
#define FIRSTNAME "Nathaniel"
#define LASTNAME "Hawk"
#define NAME FIRSTNAME + " " + LASTNAME

will crash POTC.

Let alone something like
#define MYCALL_1 myfunction(50)

Back to defines in general: they are invariant. Because they are really text subsitutes, you can't change them or otherwise treat them as variables. The upside, however, is that because of this they are not -stored- as variables either, and so their value is always what is assigned in the code (variables have their values stored on save, so when you load that game the variable will be assigned the value in the save, not the default value you assign in the code).

As long as you put them in an #included file, they will be available globally (but global here refers to their /scope/, not what they are; usually when we say global it's an abbreviation and what we really mean is 'global /variable/'); and there's no such thing as a local #define (at least in POTC--so always put them outside of functions!).

Second: references, objects, etc.
References are a special type of variable, a variable that points to another variable. They are often used to point to an object, but they can point to anything. Also, there are arefs (attribute references) can only point to objects, but they can point to any attribute in an attribute tree on that object.

Like C, you make a reference like so:
object myobj;
int myint = 5;

ref to_myobj, to_myint;
to_myobj = &myobj; //The & operators means 'the memory location of.'
to_myint = &myint;

Unlike C, you can also create references like this:
makeref(to_myobj, myobj); // note no & needed!

Also unlike C, there are attributes; and you can reference them:
myobj.attr1 = "test";
aref to_myattr;
makearef(to_myattr, myobj.attr1); // again, no &.

Footnote: We should check whether
to_myattr = &myobj.attr1;

works. I don't believe so, but don't quote me. My reasoning is that usually when you use the form someobj.someattr POTC interprets that as (the string that resides in that attribute) rather than (the attribute itself).

Note: Scheffnow's guaging tells us that using makeref is faster than directly assigning a reference (but not by -that- much).

The other key difference in POTC is that when you pass a variable to a function, and you want the function to use (i.e. reference) the original variable, not make a copy, you must do two things.
First, in the function declaration, you must use the variable type ref.
void increment_this(ref x) { x++; }

Second, when you pass a variable to that function, you must use the & operator.
//in some func:
int a = 1;
increment_this(&a);

This is directly contradictory to C, where you use the & in the function declaration and the variable's normal type.

Arefs are -always- references and thus (for some reason) don't need the &.

Ordinarily, when a function has a ref as an argument (and the variable is passed to it with &), and you want to pass that ref on to another function, you don't need to use &. However--and this is the really weird part, and in fact the opposite of how it should be--sometimes you need to even pass the ref with &.

Now, refs and arefs are mostly there to make the programmer's life easier (and allow generic functions)--you can often get by without them, by directly accessing the original variables. For example, you can use
Characters[GetMainCharacterIndex()].goodsails = 1;

rather than getting a ref to the player character and using the ref. In fact that is all that (and precisely what) GetMainCharacter() does: it returns &Characters[GetMainCharacterIndex()].
 
In answer to Dan TLW's question "Where/how to start learning POTC scripting":
General C tutorials will teach you C; Diomed has some on the first page of this thread, or just google C++ tutorial and you'll get tons.
POTC-specific: an excellent way to learn is to set POTC to run in windowed mode and play around with the console. Because POTC compiles (or at least interprets, per DCHaley above) on the fly, you can change the contents of console.c, hit F12 in game, and the console function will be reloaded and rerun.

Another way to get familiar with POTC's script engine is to (first backing up your original seadogs.c file) make a 'stripped down' seadogs.c file that includes these lines:

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->void main()
{
    
    ExitProgram();
}<!--c2--></div><!--ec2-->

Make sure ExitProgram(); is the last line in main() and otherwise it will work pretty much like regular C++. Turn on error logging in engine.ini; then you can use trace() to do output. You'll not be able to do input like this, but you can test lots of ideas and get a feel for how POTC's script language works.
 
Hey, much of that was actually new to me, thanks a lot <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
 
Got it, Nathan. Thx a lot. <img src="style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" />

<img src="style_emoticons/<#EMO_DIR#>/bounce.gif" style="vertical-align:middle" emoid=":b:" border="0" alt="bounce.gif" /> (eager to start coding)
 
<img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> lol, when I said Im beginner in C I did mean it. Im merely only using the borland c help while coding...... Always looking wildly for basic functions. They do a very sad course on school. We gonna ram to database, only merely touch c. As housewrok, managed to do a 'password protected' calculator, lol, and a some other math-doing console prog. So first need to learn c++ a bit, to understand and replace the well known delphi 5 functions, and procedures in me mind, mateys! Thanks! Im gonna dig a bit into this thisweek, and the next.
 
Ive managed to get some experience by recycling/usig old saves, because i never did started a new game, since I restarted to use POTC in february.... <img src="style_emoticons/<#EMO_DIR#>/smile2.gif" style="vertical-align:middle" emoid=":))" border="0" alt="smile2.gif" />

I figured out, that if you reload an old save, and first press 'reset controls', then press the i key, then save again, it produce a stable, upgraded savegame.

most of the time.... In othertimes, I figured out, that there is 'sneaking bugs' exist.

For example, the post build 12 march 18 and march 25 (at least the basic of them) was really unstable. They contained a bug, that caused a big crash to desktop, after you switch to the map view, which literally nailed you to one exact port.....

I figured out, that this is caused by a bad items directory file. So, if you go to the shop after installed those versions, sell/buy some mixed up code items, (getting no errormsg thattime) THEN you try to go to map, the game crashes.

( I replaced 4 files in items directory from older versions, and I never get that CTD anymore, I can shop safe. Pieter still try to figure out why, the new ones seems not contain bad data. But the new lines may refer to some other file that actually contains the bad code?? I dont know, those old files stable for me. )

if you do anything, but evade this item shopping, you can evade the crash.
But... If you saved a game after you entered the shop, and did the bad thing, your savegame contains the bad data. maybe a variable with ridicuolus content. So: save very often, and if someone get a bad savegame after switching to newer version, he saved a bug in the earlier version, find that, and use an older save to evade.
Most of the 'sneaking', later activated bugs can be saved.... But if you keep a sharp eye for unusual bugs, and always use the last safe savegame, you can import it to any new version.

I hope Its not out of topic. If It is, please PM me, and I move this into another one within a minute.
 
Got this by PM, but IMHO such general questions are best being posted in public, so that everybody can contribute to or learn from them <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->I have modified a Dialogue program as part of my re-write - I did it by modifying an existing one. (and I mean the program C file here).
I assume I need to "compile" the modded version.

If so, is it O.K. to use a C compiler or should I use a C++ one? I assume I can download these on line from what I've seen, and do you have a recommendation?<!--QuoteEnd--></div><!--QuoteEEnd-->
You don't need a compiler. all those .c files are being compiled by the game.

Most files are being compiled when you start the program. Some are being compiled only when you start a new game (all those in the "init" or "ini" folders), so any changes there take effect only if you choose the "start new game" option.

Dialogfiles, however, are being compiled when you talk to the character they have been assigned to. Which has a huge advantage: you can change and test them during the running game.
-Run your game in windowed mode(uncheck "Fullscreen modus" in config.exe), meet the character whose dialog you want to change,
-Pause the game(F1), use AltTab to switch from the game to the desktop
-open the dialog file, make a little change and save it
-AltTab back into Potc, talk to the character and check your change

The console.c file is being compiled if you press F12 during the game, which makes testing new codesections a lot easier.
 
Help from a Character Modder please:

I am well into the Jack Sparrow re-write, quest book etc. and am at a point where I need an additional character, to keep things organised.

James Norrington

Firstly I need him to be walking around Oxbay during the tutorial part of the game in a Royal Navy Midshipman's uniform. He could also be sitting in the Tavern whichever is easier.
He has a dialog which works - (I temporarily assigned it to a soldier for testing purposes)

He has an initial dialog with the player's character.

When the players character returns to Oxbay to talk to French Officer (Falise de Fluer quest) - IF he talks with Norrington again, Norrington gives him a quest item, which increases players reputation.

AFTER the freeing of Oxbay he disappears - that is, is no longer in the town. This needs to apply even if player did NOT re-talk to Norrington. (i.e. that mini-quest is dead)

At the END of the Main Quest Norrington "appears" again and will have a Lieutenants uniform (added for info in case it makes a difference - or can we use the "same" character just call up new uniform?).

Would someone be kind enough to tell me how to do this - or send me the code if it already exists.
I don't mean to sound stupid here as I think most of it can be achieved through the DIALOGS file, but I don't yet understand how a character is in a particular place and later is not (programwise).
Also please advise on associated files that need to be addressed.

Thanks in advance.
 
Let's first train the relocation with Olyver Blaxter of Oxbay. His initial "adress" is in Oxbay Port, as you can see if you look him up in characters\init\Oxbay.c :
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->    ch.location    = "Oxbay_port";
    ch.location.group = "goto";
    ch.location.locator = "goto6";<!--c2--></div><!--ec2-->
A command that changes this adress would be this:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->ChangeCharacterAddressGroup(CharacterFromID("Olyver Blaxter"), "Oxbay_town", "goto", "goto1");<!--c2--></div><!--ec2-->Put that into console.c, go to Oxbay, meet Olyver and press F12. Olly will be teleported, and if you go to Oxbay town he should be there.
 
Now open Gregor Samsa_dialog.c, find the case which closes the dialog

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->case "exit":
    Diag.CurrentNode = Diag.TempNode;
    NPChar.quest.meeting = NPC_Meeting;
    DialogExit();
break;<!--c2--></div><!--ec2-->and insert a similar command there :
 
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->case "exit":
    Diag.CurrentNode = Diag.TempNode;
    NPChar.quest.meeting = NPC_Meeting;
    DialogExit();
    ChangeCharacterAddressGroup(CharacterFromID("Gregor Samsa"), "Oxbay_tavern", "goto", "goto2");
break;<!--c2--></div><!--ec2-->
Talk to Gregor Samsa, and after the dialog ends he will be teleported.

In such a dialogfile you can also write
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->ChangeCharacterAddressGroup(npchar, "Oxbay_tavern", "goto", "goto2");<!--c2--></div><!--ec2-->
cause NPChar is a variable that stands for the character you talk to.


If such a command should not work check if you got the right location id and if that location actually has the locator that you used.



Of course it may look a bit odd if the person you talk to disolves into vapour right before your eyes. But there are also commands which make a character walk or run to an exit before the teleport takes place. One such example is the scene if you awaken in a tavernroom after being rescued from death. The taverngirl will walk to the door and reappear in the bar after talking to you.

The code for that is in eng_officiant_dialog.c, which is the common dialogfile for all taverngirls:

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->case "ExitS":
    DialogExit();
    NextDiag.CurrentNode = NextDiag.TempNode;
    ...                    

AddDialogExitQuest("ResurrectionEvent_OfficiantLeaves");
break;<!--c2--></div><!--ec2-->
AddDialogExitQuest runs a programquest after closing the dialog. Such "quests" are in fact little program sections that you find in the quests\quest_reactions.c or both_reactions.c file. So open that one and search for "ResurrectionEvent_OfficiantLeaves" :

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->case "ResurrectionEvent_OfficiantLeaves":
    LAi_SetActorType(ResurrectingOfficiant);
    LAi_ActorGoToLocation(ResurrectingOfficiant, "reload", "reload1", ResurrectingOfficiantLocation, ResurrectingOfficiantGroup, ResurrectingOfficiantLocator, "ResurrectionEvent_OfficiantLeftTavernUpstairs", 10.0);
break;<!--c2--></div><!--ec2-->
The LAi_ActorGoToLocation command
-makes the character ResurrectingOfficiant go to the reload/reload1 locator,
-teleports her to the ResurrectingOfficiantlocation/..group/..locator,
-runs the "ResurrectionEvent_OfficiantLeftTavernUpstairs" quest after 10.0 seconds

That quest is right below. What you need from it is only the command that resets the "actor" AI back to the initial AI of the charachter.(cause an NPC in actor mode does nothing but wait for actor commands)

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->case "ResurrectionEvent_OfficiantLeftTavernUpstairs":
    LAi_SetWaitressType(ResurrectingOfficiant);
    ...
break;<!--c2--></div><!--ec2-->
Does this help you? Or is it already too comlicated for a start? Feel free to ask what you need to know. Four years ago *I* was the one who had too ask such questions, and only that way we can learn.

More on changing characters another day <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
 
No problem with moving character, thanks <img src="style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" /> . I changed his outfit to make him easier to see while testing. <img src="style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" /> (Note: had to start New Game - f12 did not work for those actions)

I used the soldier's dialog (cos that's the one I had previously modified with the NEW dialog for Norrington - the character I am adding at this part of the program). The dialog interface worked fine.

No problem, wonderful, super brilliant, rum all round <img src="style_emoticons/<#EMO_DIR#>/me.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="me.gif" />

Added NEW dialog files - in both program\dialog & program\dialog\english
James_Norrington in both cases.

However, the files save as ".txt"
Stupid question time: How do I save them as "C" and "H" files ?

If I modify an existing file the C or H remain again no problem - I used notepad for this O.K.
I tried the Notepad++ but then only got .file suffix

I know I am missing something basic here ! <img src="style_emoticons/<#EMO_DIR#>/dunno.gif" style="vertical-align:middle" emoid=":shrug" border="0" alt="dunno.gif" />
 
Continuing with Norrington:
Sooo ... I got round the above problem another way (re-named the soldiers files I had modified to Norrington - then copied original soldiers files back into program from another copy of the game)

I would still like to have an answer to my previous question though on file suffixes.

I have used:
model.id = "rn_mdshp18_2";
for his uniform and that works too.
 
Gongrats on your progress <img src="style_emoticons/<#EMO_DIR#>/me.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="me.gif" />
As for the file suffixes, I never start a new file in the editor but copy an existing .c file, rename it and change the content.

Has also the huge advantage that you have the structure of the code already. The more content you copy the less typos you get (had to learn that the hard way once upon a time <img src="style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" /> )
 
Is there a "one line" command that gets a NPcharacter to come and talk to you when you are in the vicinity? (or a character I could look up - the only one I could think of right now was Danielle and Vincent but that aslo included dialog jumping from NPchar to NPchar - too heavy at the moment, if there is an easier way)

The case - NPchar in Oxbay town
in walks Pchar (through gates - front or back)
NPchar walks upto Pchar and starts the dialog

and, what do:
ch.old.name = "Olyver";
ch.old.lastname = "Blaxter";
effect
I know
ch.name = LanguageConvertString(tmpLangFileID,"Olyver");
ch.lastname = LanguageConvertString(tmpLangFileID,"Blaxter");
produce the "on screen" names for the NPChar.
also:
ch.id = "Olyver Blaxter";
what does that effect

Thanks
 
Open the file in Notepad, press Save As and type in "James Norrington_dialog.c" and "James Norrington_dialog.h". That should work just fine. In case it doesn't, you can make Windows disable "Hide filenames for known filetypes" in Windows, after which you can change the file extensions by renaming the file in Windows.

ch.id = "Olyver Blaxter"; is just to identify the character. Every character has a seperate ID which is used all over the place for all sorts of things. If you want to make a character do something, the task is assigned to the character ID. ch.old attributes have something to do with the translation mod. Just add them to your character just to be sure. I don't know exactly what it does. <img src="style_emoticons/<#EMO_DIR#>/dunno.gif" style="vertical-align:middle" emoid=":shrug" border="0" alt="dunno.gif" />

To make a character walk up to you and start a talk, you'll need to set an Enter Location Quest. This can be done by adding this to PROGRAM\CHARACTERS\characters_init.c:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->    ch.quest.Norrington = "";
    ch.quest.Norrington_start.win_condition.l1 = "location";
    ch.quest.Norrington_start.win_condition.l1.character = ch.id;
    ch.quest.Norrington_start.win_condition.l1.location = "Oxbay_town";
    ch.quest.Norrington_start.win_condition = "Norrington_start";<!--c2--></div><!--ec2-->

Then add this into PROGRAM\quests_reaction.c:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->        case "Norrington_start":
            SetEnterLocationQuest("Oxbay_town", "Norrington_start_check", 0); // "Norrington_start_check" will now be executed EVERY TIME you enter Oxbay town!
        break;

        case "Norrington_start_check":
            if(Pchar.quest.Begining.over == "yes";)
            // This check makes sure that the Norrington quest starts after the tutorial is finished. You can change/add the conditions here to your liking
            {
                // Code here will be executed when you enter Oxbay town AND your check above is TRUE
            }
        break;<!--c2--></div><!--ec2-->

You can use the following bits and pieces of code for your quest cases:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->    LAi_SetActorType(characterFromID("Norrington")); // Sets character with ID "Norrington" to Actor Type
    LAi_ActorFollow(characterFromID("Norrington"), PChar, "Norrington_talk_1", 10.5); // Lets character with ID "Norrington" walk up to the player, after which quest case "Norrington_talk_1" is executed. If Norrington doesn't reach the player within 10.5 seconds, quest case "Norrington_talk_1" is executed anyway<!--c2--></div><!--ec2-->

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->    LAi_SetActorType(characterFromID("Norrington")); // Sets character with ID "Norrington" to Actor Type
    LAi_ActorFollow(characterFromID("Norrington")), PChar, "Norrington_talk_1", 10.5); // Lets character with ID "Norrington" walk up to the player, after which quest case "Norrington_talk_1" is executed. If Norrington doesn't reach the player within 10.5 seconds, quest case "Norrington_talk_1" is executed anyway<!--c2--></div><!--ec2-->

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->    DeleteEnterLocationQuest("Oxbay_town", "Norrington_start_check"); // Once this line is run, the Enter Location Quest is removed and "Norrington_start_check" will not be executed next time you get to Oxbay town.<!--c2--></div><!--ec2-->

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->            case "Norrington_talk_1":
            LAi_ActorWaitDialog(PChar, characterFromID("Norrington"));
            LAi_ActorDialog(characterFromID("Norrington"), PChar, "", 1.0, 1.0); // Makes Norrington start a conversation with the player when quest case "Norrington_talk_1" is executed
        break;<!--c2--></div><!--ec2-->

I think this will be enough for today. Feel free to come up with more questions though. <img src="style_emoticons/<#EMO_DIR#>/doff.gif" style="vertical-align:middle" emoid=":doff" border="0" alt="doff.gif" />
 
Many thanks for the above. <img src="style_emoticons/<#EMO_DIR#>/me.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="me.gif" />

Next questions:
I notice that in characters.init, various characters are defined in specific locations or action types.
For example: locations - Oxbay, Redmond etc.
action types - Officers, Story Characters, Temp Quest enemy
I am correct in assuming that they were put there to make it easier to find them later, or do these locations have specific program related links?

I also notice that Rheims (in StoryCharacters) has his defined location, location group and location indicator all defined as "". Is that to allow him to "appear" in different islands?

and what is the significance of this line: Dialog.snd = "voice\RARH\RARH006";

Sorry for the dumb questions here, I know I could find out by playing with the files, but I am well into the mod - I can play through to Greenford attack - but I haven't changed Silehard yet as he jumps location from residence to jail, and I haven't got my head round that yet with the character changes I have made for that time. I also need to change Rheims, so I am looking for some short cuts. (I was a programmer but not C or C++ and am well aware that a little knowledge is a dangerous thing! <img src="style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" /> )

Thanks in advance.
 
<!--quoteo(post=188173:date=Apr 6 2007, 08:59 PM:name=Short Jack Gold)--><div class='quotetop'>QUOTE(Short Jack Gold @ Apr 6 2007, 08:59 PM) [snapback]188173[/snapback]</div><div class='quotemain'><!--quotec-->I notice that in characters.init, various characters are defined in specific locations or action types.
For example: locations - Oxbay, Redmond etc.
action types - Officers, Story Characters, Temp Quest enemy
I am correct in assuming that they were put there to make it easier to find them later, or do these locations have specific program related links?<!--QuoteEnd--></div><!--QuoteEEnd-->
You mean the names of the .c files in which the character data are? They don't matter, the developers only put the characters in different files for convenience sake. The code in characters\init_characters.c calls all those files one after the other when the game is initialized, so for the program it makes no difference in which file a character is
<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->I also notice that Rheims (in StoryCharacters) has his defined location, location group and location indicator all defined as "". Is that to allow him to "appear" in different islands?<!--QuoteEnd--></div><!--QuoteEEnd-->
Exactly. He is backstage, waiting for his appearance. Many questcharacters are initialized without specific location. Those data are set later by the questcode.
To make a character disappear from the game you can do the reverse: set his adress to "".
<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->and what is the significance of this line: Dialog.snd = "voice\RARH\RARH006";<!--QuoteEnd--></div><!--QuoteEEnd-->
None that i know. i always write my dialogs without them.
I assume they were supposed to play soundfiles of the dialog, but that that feature never made it into the final release.
 
Terrific CCC - Thanks a lot for the clarification - makes life sooo much easier. <img src="style_emoticons/<#EMO_DIR#>/me.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="me.gif" />
(I don't want to go clumping about in my big boots all over someone else's work without some idea as to what I'm doing!)
 
Back
Top