Add Item with Script?

Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /var/www/pied-piper.ermarian.net/includes/common.inc).
AuthorTopic: Add Item with Script?
Infiltrator
Member # 5785
Profile #0
Even though many have posted about this before, I have never truely undestood how you do it. I have never had a reason to do it, but now I do. I have misplaced an item (Putrefied Gauntlets), and I want to it back. How do I add it? I got the Item code (Someone posted it before on the board)

--------------------
"..The seventh wave of Thrall stumbled and climbed over the slippery, piled dead and Mazzarin saw The Watcher with them and at last knew the number of his days."
Posts: 522 | Registered: Wednesday, May 4 2005 07:00
Apprentice
Member # 5980
Profile Homepage #1
You need to use the function "give_reward(num)"
where num is the code of the item (in the case of your gloves 345)

All you need to do is to ad "reward_give(345);" in a dialogue script (in the "code=" section).

--------------------
[My homepage] - [The Reasoned Character Editor] - [NOSE(Gf3 version)] - [NOSE(Gf2 version)]
Posts: 45 | Registered: Saturday, June 18 2005 07:00
Infiltrator
Member # 5785
Profile #2
Can I type give_reward345 in the Shift+D box, or is there somewhere else?

--------------------
"..The seventh wave of Thrall stumbled and climbed over the slippery, piled dead and Mazzarin saw The Watcher with them and at last knew the number of his days."
Posts: 522 | Registered: Wednesday, May 4 2005 07:00
Apprentice
Member # 5980
Profile Homepage #3
I'm not very informed about the cheat codes :-/
I was talking of the scripts... in which zone are you precisely?

--------------------
[My homepage] - [The Reasoned Character Editor] - [NOSE(Gf3 version)] - [NOSE(Gf2 version)]
Posts: 45 | Registered: Saturday, June 18 2005 07:00
Infiltrator
Member # 5785
Profile #4
Fort Wilton.

Which program do I need to open the script with?

--------------------
"..The seventh wave of Thrall stumbled and climbed over the slippery, piled dead and Mazzarin saw The Watcher with them and at last knew the number of his days."
Posts: 522 | Registered: Wednesday, May 4 2005 07:00
Triad Mage
Member # 7
Profile Homepage #5
You need a text editor like TextEdit or NotePad or something.

--------------------
"At times discretion should be thrown aside, and with the foolish we should play the fool." - Menander
====
Drakefyre's Demesne - Happy Happy Joy Joy
Encyclopedia Ermariana - Trapped in the Closet
====
You can take my Mac when you pry my cold, dead fingers off the mouse!
Posts: 9436 | Registered: Wednesday, September 19 2001 07:00
Infiltrator
Member # 5785
Profile #6
I got that (NotePad), and I found the script, I am just really unsure where to write anything. I don't want to emss anything up. More detailed help, please?

--------------------
"..The seventh wave of Thrall stumbled and climbed over the slippery, piled dead and Mazzarin saw The Watcher with them and at last knew the number of his days."
Posts: 522 | Registered: Wednesday, May 4 2005 07:00
Shaper
Member # 5437
Profile #7
There are a few places you could put reward_give(). Here's how to put it into a talknode…

begintalknode 79;
state = 73;
nextstate = 70;
condition = get_flag(2,8) == 0 && get_stat(20) >= 4;
question = "You should donate something to me now. I am a Shaper, and I require your aid.";
text1 = "Hinman frowns and looks down at the floor. He knows that outsiders must give aid to Shapers when requested. Then he fetches a pair of crystals and hands them to you.";
text2 = "_Here, young Shaper. I hope these help._";
code =
set_flag(2,8,1);
reward_give(120);
reward_give(121);
break;
A less complicated talknode…

begintalknode 1;
state = -1;
personality = 0;
nextstate = -1;
condition = 1;
question = "Please give me a pair of gloves";
text1 = "You receive a pair of gloves";
code = reward_give(345);
break:
Edit: fix

[ Friday, July 15, 2005 18:40: Message edited by: Dolphin. ]
Posts: 2032 | Registered: Wednesday, January 26 2005 08:00
Apprentice
Member # 5980
Profile Homepage #8
For example you could open z33fortwiltdlg.txt
and change this:
begintalknode 10;
state = -1;
nextstate = -1;
condition = 1;
question = "special";
text1 = "The sign says:";
text2 = " LONG TERM STORAGE!";
text3 = " Stay out! Alarms are in place!";
Into this:
begintalknode 10;
state = -1;
nextstate = -1;
condition = 1;
question = "special";
text1 = "The sign says:";
text2 = " LONG TERM STORAGE!";
text3 = " Stay out! Alarms are in place!";
code =
code = reward_give(345);
break;
Then you'll just have to click on the sign that usually says "LONG TERM STORAGE" to get your gloves.

--------------------
[My homepage] - [The Reasoned Character Editor] - [NOSE(Gf3 version)] - [NOSE(Gf2 version)]
Posts: 45 | Registered: Saturday, June 18 2005 07:00
Infiltrator
Member # 5785
Profile #9
It's not working. I have having a MAJOR issue trying to figure out where to put all the spaceing, and when to press enter for the next line, since either you guys have added that (Because it looks like this for me):

begintalknode 10;
state = -1;
nextstate = -1;
condition = 1;
question = "special";
text1 = "The sign says:";
text2 = " LONG TERM STORAGE!";
text3 = " Stay out! Alarms are in place!";

or the forum have scrambled it up.

I tried just adding the words, but apparently any single space error makes the game flipp out, and it's sometimes hard to see if there should be "Code=" or "Code =" and how many spaces I am to put on the line under that, so that the "o" in the second "code" fits in right under the "=" in the first "code" (As you have posted it.)

Edit: I solved the issue myself with some constructive thinking. I used the tab key, and added a code command and a break command, so that it looks like this:

begintalknode 10;
state = -1;
nextstate = -1;
condition = 1;
question = "special";
text1 = "The sign says:";
text2 = " LONG TERM STORAGE!";
text3 = " Stay out! Alarms are in place!";
code = reward_give(345);
break;

Why I would need a first "code" that said nothing beats me. Perhaps you just typed that out wrong? And perhaps your TextEdit or the way you copy make the script look curved and with strange spaceings, while it is actually just straight (as I copied.)

[ Saturday, July 16, 2005 03:18: Message edited by: Contra ]

--------------------
"..The seventh wave of Thrall stumbled and climbed over the slippery, piled dead and Mazzarin saw The Watcher with them and at last knew the number of his days."
Posts: 522 | Registered: Wednesday, May 4 2005 07:00
...b10010b...
Member # 869
Profile Homepage #10
The original scripts do have indentations (the "strange spacings" at the start of the line). They're not important for the function of the script, but they make it easier to read. It's probable that whatever text editor you're opening the scripts in is ignoring the indentation for some reason.

[ Saturday, July 16, 2005 03:38: Message edited by: Thuryl ]

--------------------
The Empire Always Loses: This Time For Sure!
Posts: 9973 | Registered: Saturday, March 30 2002 08:00
Apprentice
Member # 5980
Profile Homepage #11
quote:
Why I would need a first "code" that said nothing beats me
It's not exactly like this ;)

The scripting language used in the Geneforge series requires to end commands with a ;
This means that
code = give_reward(345);
break;

is the same as
code =
give_reward(345);
break;

Just think that code means that some sort of script must be executed and break means that the scripting has ended.

--------------------
[My homepage] - [The Reasoned Character Editor] - [NOSE(Gf3 version)] - [NOSE(Gf2 version)]
Posts: 45 | Registered: Saturday, June 18 2005 07:00