Aller au contenu

Photo

class Adding - Probably Noob Issue


  • Veuillez vous connecter pour répondre
30 réponses à ce sujet

#26
Rolo Kipp

Rolo Kipp
  • Members
  • 2 791 messages
<checks his pouches...>

Hardcore UFO wrote...

I don't get it...
...
I didn't find documentation on this, but are you sure that SetLocalInt will create a variable on a character if it does not already exist there? I know I keep mentioning it, but I want to make sure. The rest of the occurences don't make sense, but they would make sense if the variable was somehow not put into existance for the value switches.


Just a possibility; are you trying to set the variable *before* the PC is loaded?  I've seen several warnings in various tutorials to start doing things in the starting *area's* OnEnter (Rather than OnClientEnter) to avoid this behavior. 

Since I have stuck to that advice, so far (knock on my pointy wooden head) I haven't seen any of those symptoms.

<...to be sure he doesn't have it, either>

#27
Rolo Kipp

Rolo Kipp
  • Members
  • 2 791 messages
...
Double post

(How does "You don't have permission to view this forum" translate into "I already posted it but I'm gonna fool you into re-typing the whole thing"?) :-P

Modifié par Rolo Kipp, 29 août 2011 - 06:33 .


#28
Androrc

Androrc
  • Members
  • 101 messages

Hardcore UFO wrote...

I don't get it...

I've tried with the OnClientEnter script as noted and the OnLevelUp setting the variable to 0. Then I tried the same thing with a 1 instead in the TL_AllowMERCH entry of the cls_peres_merch.2da. Then I tried reversing the 1 and 0 from both scripts, along with both variations of the 2da. The class is always available at level 2, regardless.

I didn't find documentation on this, but are you sure that SetLocalInt will create a variable on a character if it does not already exist there? I know I keep mentioning it, but I want to make sure. The rest of the occurences don't make sense, but they would make sense if the variable was somehow not put into existance for the value switches.


Try using "FALSE" and "TRUE" in the scripts, rather than 0 and 1 (while keeping 0 and 1 in the 2da).

If that doesn't solve the issue, then try simply not setting the variable at all, while making the cls_pres_merch.2da's setting be 1. See if that stops the class from being available at level up before trying to set other things.

How I do it in my would-be module (I've tested it): for the Cleric, for instance, I set the "AllowCleric" variable to 1 in the 2da. And then use this script during a conversation to make the class the available at level-up:

void main()
{
    object oPC = GetPCSpeaker();
    int nLevel = GetHitDice(oPC) + 1;
    int nCost = nLevel * 500;

    TakeGoldFromCreature(nCost, oPC, FALSE);

    SetLocalInt(oPC, "AllowCleric", TRUE);
}

Modifié par Androrc, 29 août 2011 - 07:11 .


#29
Hardcore UFO

Hardcore UFO
  • Members
  • 86 messages
I don't understand what's wrong, really, but even by starting at square one with just a conversation that sets the variable to TRUE, I find once I have the XP that I don't even need to activate the conversation node that fiddles with variables. It's already unlocked. Even with no script in the entire module that modifies the variable, aside from the conversation.

So I do the same thing, but in a blank module with no other haks that could possibly be confounding things (I only have CEP anyway) and the same occurs. Then I stick the line "TL_AllowMERCH       6" in the 2da much to the same effect; I then tried removing the variable requirement to no effect either. The other requirements are being ignored outright.

Now, my cls_pres_merch uses an existing file of the same format as a template (with changed values) and I decuple-checked that the classes.2da entry for it was formatted the same as every other row (i.e. is in the right column). That leaves few things that could be wrong. Is it possible that in erasing a few lines of the cls_pres_harper.2da an erased space before the line returns to the next could cause a misreading? How many spaces are needed after the very last column, and is there a need for spaces under the last row entered (some 2da files seem to have that)?

Modifié par Hardcore UFO, 30 août 2011 - 04:01 .


#30
Hardcore UFO

Hardcore UFO
  • Members
  • 86 messages
One thing I just noticed (and certainly hope is not the cause) is that the 2da files I have created in Notepad (by copying an existing 2da outright) come to be listed as simply "Text Document" in the file type, while the 2da files read "2da". With some poking around, I haven't found how to convert them into 2da, if that matters.

Hitherto I had assumed that 2da files in fact were Text Documents without a special type, but if there's a chance this is the problem I'll adress it. I just don't know how to make a 2da file if copying one, modifying its contents, then clicking Save As (different name) creates something other than a 2da.

Now I'm rambling. Sorry, this is just proving more finnicky and time consuming than I first thought it would be.

Modifié par Hardcore UFO, 30 août 2011 - 04:11 .


#31
Hardcore UFO

Hardcore UFO
  • Members
  • 86 messages
Oh.

My.

God.

I just added ".2da" at the end of the files and it's now working. What baffles me is that all this time cls_pres_merch was not working, but the others were (on a merchant level-up, I had the right skill points and hit points). I feel so dumb.

Thank you muchly to everyone for taking the time to try and help me. I'm sorry I'm such a noob.

Oh.

My.

God.