| View previous topic :: View next topic |
| Author |
Message |
Lexx Mr. Lexx

Joined: 23 Dec 2005 Posts: 261 Location: Bra/ Germ Honey!
|
Posted: Sun Jul 29, 2007 1:29 am Post subject: Adding a new perk |
|
|
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 |
|
 |
lisac2k Wasteland survivor

Joined: 25 Nov 2005 Posts: 520 Location: Sand, sun and the vultures.
|
Posted: Sun Jul 29, 2007 11:43 pm Post subject: |
|
|
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 |
|
 |
lisac2k Wasteland survivor

Joined: 25 Nov 2005 Posts: 520 Location: Sand, sun and the vultures.
|
Posted: Mon Jul 30, 2007 10:18 am Post subject: |
|
|
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 |
|
 |
Lexx Mr. Lexx

Joined: 23 Dec 2005 Posts: 261 Location: Bra/ Germ Honey!
|
Posted: Mon Jul 30, 2007 10:23 am Post subject: |
|
|
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 |
|
 |
lisac2k Wasteland survivor

Joined: 25 Nov 2005 Posts: 520 Location: Sand, sun and the vultures.
|
Posted: Mon Jul 30, 2007 10:28 am Post subject: |
|
|
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 |
|
 |
Lexx Mr. Lexx

Joined: 23 Dec 2005 Posts: 261 Location: Bra/ Germ Honey!
|
Posted: Mon Jul 30, 2007 2:04 pm Post subject: |
|
|
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 |
|
 |
lisac2k Wasteland survivor

Joined: 25 Nov 2005 Posts: 520 Location: Sand, sun and the vultures.
|
Posted: Mon Jul 30, 2007 2:17 pm Post subject: |
|
|
Good to hear you've fixed it
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 |
|
 |
|