Jump to content

Add Item with Script?


Recommended Posts

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)

Link to comment
Share on other sites

There are a few places you could put reward_give(). Here's how to put it into a talknode…

 

Code:
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…

 

Code:
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
Link to comment
Share on other sites

For example you could open z33fortwiltdlg.txt

and change this:

Code:
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:
Code:
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.
Link to comment
Share on other sites

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.)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Quote:
Why I would need a first "code" that said nothing beats me
It's not exactly like this wink

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.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...