Fallout2: Survivor MODs Forum Index
  Register FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in 
Log in to check your private messages  ·  fChat
Adding a new perk

 
Post new topic   Reply to topic    Fallout2: Survivor MODs Forum Index -> Technical modding
View previous topic :: View next topic  
Author Message
Lexx
Mr. Lexx
Mr. Lexx


Joined: 23 Dec 2005
Posts: 261
Location: Bra/ Germ Honey!

PostPosted: Sun Jul 29, 2007 1:29 am    Post subject: Adding a new perk Reply with quote

Well, I am trying to add a new perk to the game. It seems to work good, but I have one problem: The perk is there from the beginning.

I made a new var in global.h.. the line is:

Code:
#define GVAR_EXAMPLE        (697)


Then I added this lines in the karmavar.txt:

Code:
# GVAR_EXAMPLE
697, 100, 1026, 1126


After this, I opened the editor.msg file and added this lines:

Code:
{1026}{}{Example Title}


and:

Code:
{1126}{}{Example Text.}


I want to activate the perk with gvar +1 in a dialog, so I added this line to the specific dialog:

Code:
set_global_var(GVAR_EXAMPLE,1);


I also tried "inc_global_var(GVAR_EXAMPLE);" but (and I don't know why) it won't work.

Then I added this to the VAULT13.GAM at the end of the file:

Code:
GVAR_EXAMPLE                :=0;    //      (697)




But like I said... the perk is there from the beginning. I started a new game and there is the perk.. :/

I tried it with Lich's tutorial. You can find it here. But I can't read the text, so I tried to orient myself with the file- and gvar names.

Does someone have experience with this?
_________________
Back to top
View user's profile Send private message Visit poster's website
lisac2k
Wasteland survivor
Wasteland survivor


Joined: 25 Nov 2005
Posts: 520
Location: Sand, sun and the vultures.

PostPosted: Sun Jul 29, 2007 11:43 pm    Post subject: Reply with quote

Well, it seems you did everything well. I dunno what could be a problem...

I added a new perk to my Vault Rats MOD too, maybe you could check it out in the source scripts and other files:

Vault Rats MOD
Source scripts
_________________
Survivor in the wasteland. Admin of this forum.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
lisac2k
Wasteland survivor
Wasteland survivor


Joined: 25 Nov 2005
Posts: 520
Location: Sand, sun and the vultures.

PostPosted: Mon Jul 30, 2007 10:18 am    Post subject: Reply with quote

OK, did you add the NEW GRAPHICS for the perk into the DATA/ART/SKILLDEX inventory and edited SKILLDEX.LST file?

Also, you can add a debug (I prefer regular display) message to map_update_p_proc, so you can track down your GVAR easier:

Code:
display_msg("GVAR=" + global_var(GVAR_EXAMPLE));

_________________
Survivor in the wasteland. Admin of this forum.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Lexx
Mr. Lexx
Mr. Lexx


Joined: 23 Dec 2005
Posts: 261
Location: Bra/ Germ Honey!

PostPosted: Mon Jul 30, 2007 10:23 am    Post subject: Reply with quote

No, I don't want to make a new graphic for this perk, so I used a graphic, that already exist.

/Edit: Okay, with the "debug" I found out, that the gvar don't count up.. strange..
_________________
Back to top
View user's profile Send private message Visit poster's website
lisac2k
Wasteland survivor
Wasteland survivor


Joined: 25 Nov 2005
Posts: 520
Location: Sand, sun and the vultures.

PostPosted: Mon Jul 30, 2007 10:28 am    Post subject: Reply with quote

Re-compile the script which should set the GVAR once again... That might help.
_________________
Survivor in the wasteland. Admin of this forum.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Lexx
Mr. Lexx
Mr. Lexx


Joined: 23 Dec 2005
Posts: 261
Location: Bra/ Germ Honey!

PostPosted: Mon Jul 30, 2007 2:04 pm    Post subject: Reply with quote

Hmm this is a strange problem. I get it to work, but not like "normal".

At first I used this way to set the gvar:

Code:
set_global_var(GVAR_EXAMPLE,1);


But it wouldn't work...

Then I tried it this way:

Code:
set_global_var(653,1);


The number instead of the defined name.... and now it works. I checked the spelling of the gvar name too, but it was correct... so.. it is strange..
_________________
Back to top
View user's profile Send private message Visit poster's website
lisac2k
Wasteland survivor
Wasteland survivor


Joined: 25 Nov 2005
Posts: 520
Location: Sand, sun and the vultures.

PostPosted: Mon Jul 30, 2007 2:17 pm    Post subject: Reply with quote

Good to hear you've fixed it Very Happy
So, the names in global.h and Vault13.gam are the same... This is a strange problem, I admit.

Check if the name contains lower case characters. They all should be upper case (but you probably know this already)... E.g. EXAMPLE is good, but EXAMPlE isn't, because of the "l" (lower case L)
_________________
Survivor in the wasteland. Admin of this forum.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Fallout2: Survivor MODs Forum Index -> Technical modding All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum