English Scripting Questions

2,429 replies
Goto Page
To the start Previous 1 2 ... 78 79 80 ... 121 122 Next To the start
09.11.09 08:59:49 am
Up
JadeStone
User
Offline Off
Ok im trying to make it so you can bottle salt water and fresh water so heres my script i did a fake part as you can see inarea_saltwater i want to make it so i can do that because if i do inarea_fresh water and make it 0 then i can bottle salt water wherever i am so im trying to make it so if your close to salt water get salt water and if fresh water get fresh water.

     on:usesea {
          if ( ((count_behaviourinrange("object","fountain",50)+count_behaviourinrange("object","watersource",50))>0) or (inarea_freshwater("unit",1)==1) ){
               alteritem 1,38;
               msg "I filled the bottle!",4;
               speech "positive";
          } else {
          if (inarea_saltwater("unit",1)==1) {
               alteritem 1,499;
               msg "I filled the bottle!",4;
               speech "positive";
          } else {
               msg "I have to be close",3;
               msg "to water!",3;
               speech "negative";
               }
          }
     }
edited 1×, last 09.11.09 08:31:44 pm
09.11.09 09:10:41 am
Up
Withoutname
User
Offline Off
I think that you need to change event on:usesea in game.inf, useing inhand commands.
My own mod, The Mod Without Name. Want to join team?
09.11.09 09:16:32 am
Up
Vibhor
User
Offline Off
Theres another problem
that every time you press use button you will get msg
you have to be close
which means spamming
My avatar describes my personality the best....Douchebag who have to save the princess without speaking anything
09.11.09 10:27:29 am
Up
JadeStone
User
Offline Off
nvm that one i need help with this one:
Spoiler >

Spoiler >



IF I DONT GET HELP ON THIS IM SHUTTING DOWN XIOLION THIS FEATURE WRAPS THE WHOLE SYSTEM OF XIOLION SO IF THIS DOESNT WORK YOU CANT MAKE HALF OF ALL OF THE THINGS IN XIOLION AND CANT MAKE MAIN FEATURES TO SURVIVE ON XIOLION!
edited 2×, last 09.11.09 08:47:14 pm
09.11.09 10:24:36 pm
Up
Bloodshot
User
Offline Off
1 you've got to add another bracket closing if ($order==0){
and on the menu you've got to add script=start and script=end. I would also check your brackets again just to be safe, and tabbing every time you open a bracket is a good way to keep track of things.
It is better to fail and then succeed than to succeed in the first place IMG:http://i420.photobucket.com/albums/pp281/L31ch3/Userbars/Strandedgamerub.png
10.11.09 12:21:52 am
Up
JadeStone
User
Offline Off
Ok now it doesnt error but it doesnt do anything either:
(This is in the Game.inf so theres already start and end)
Spoiler >
10.11.09 12:52:53 am
Up
Bloodshot
User
Offline Off
Should be this...
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
on:usesea { 
               temp $menuclass,$menuid; 
               $menuclass=currentclass(); 
               $menuid=currentid(); 
                         if ($order==0){ 
                         dialogue "start","sys\scripts\game.s2s"; 
               }
               if ($order>0){ 
               if ($order==1){ 
                             if (inarea_freshwater("unit",1)) { 
                                   process "drinking",1000; 
                                    drink 0,0,25,0; 
                          }else{ 
                                   process "drinking",1000; 
                                      drink 0,0,-15,0; 
                                   msg "Ugh! Saltwater!"; 
                    }
                         } elseif ($order==2){ 
                              if (inarea_freshwater("unit",1)) { 
                                   alteritem 1,106,1,38; 
                                   msg "I filled the bottle!",4; 
                                   speech "positive"; 
                         }else{ 
                              if (count_stored("self",106)>0){ 
                              alteritem 1,106,1,499; 
                              msg "I filled the bottle!",4; 
                              speech "positive"; 
                          } 
                  } $order=0;
           }
It is better to fail and then succeed than to succeed in the first place IMG:http://i420.photobucket.com/albums/pp281/L31ch3/Userbars/Strandedgamerub.png
10.11.09 01:56:59 am
Up
JadeStone
User
Offline Off
I get this error so i added 2 brackets and it just fixed it but dident do anything when i used the water except open the menu and when i clicked an option the bored went blank...

Try working on it on yours heres the code:

Error:
Somthing like missing bracket at like the end line.

Game.inf:
on:usesea {
temp $menuclass,$menuid;
$menuclass=currentclass();
$menuid=currentid();
if ($order==0){
dialogue "start","sys\scripts\game.s2s";
}
if ($order>0){
if ($order==1){
if (inarea_freshwater("unit",1)) {
process "drinking",1000;
drink 0,0,25,0;
}else{
process "drinking",1000;
drink 0,0,-15,0;
msg "Ugh! Saltwater!";
}
} elseif ($order==2){
if (inarea_freshwater("unit",1)) {
alteritem 1,106,1,38;
msg "I filled the bottle!",4;
speech "positive";
}else{
if (count_stored("self",106)>0){
alteritem 1,106,1,499;
msg "I filled the bottle!",4;
speech "positive";
}
} $order=0;
}
}
}


Game.s2s:
page=start
title=Water Menu
text=start
What should i do?
text=end
button=gw,Gather Water
button=dw,Drink Water
button=action:close,Nothing

page=gw
setlocal $menuclass,$menuid,"order",1;
closemenu;

page=dw
setlocal $menuclass,$menuid,"order",2;
closemenu;
edited 1×, last 10.11.09 02:21:24 am
10.11.09 02:11:31 am
Up
Bloodshot
User
Offline Off
When You use the elseif you're saying if the order is NOT greater than zero but IS equal to 2. This is an impossibility. Again, for the pages, you need to add script=start and script=end on the ends of your script.
page=gw
script=start
setlocal $menuclass,$menuid,"order",1;
closemenu;
script=end
Keep learning
It is better to fail and then succeed than to succeed in the first place IMG:http://i420.photobucket.com/albums/pp281/L31ch3/Userbars/Strandedgamerub.png
10.11.09 02:22:17 am
Up
JadeStone
User
Offline Off
LOL I FROGOT THE SCRIPT=START AND END FOR IT!

Ok now when i use it it only wants to drink it and not gather it no matter what option you choose.
edited 1×, last 10.11.09 03:21:26 am
10.11.09 04:00:15 am
Up
Bloodshot
User
Offline Off
Did you forget $order?
It is better to fail and then succeed than to succeed in the first place IMG:http://i420.photobucket.com/albums/pp281/L31ch3/Userbars/Strandedgamerub.png
10.11.09 05:19:43 am
Up
JadeStone
User
Offline Off
I KNOW SOMTHING STUPID IS HAPPENING

          if (inarea_freshwater("unit",1)) {
               process "drinking",1000;
               drink 0,0,25,0;
          }else{
          if (count_stored("self",106)>0){
               alteritem 1,106,1,499;
               msg "I filled the bottle!",4;
               speech "positive";
                    }
               }
          }

why isent this working?
edited 1×, last 11.11.09 12:31:14 am
11.11.09 12:33:59 am
Up
Bloodshot
User
Offline Off
it should be
}elseif (count_stored("self",106)>0){
instead of
}else{
if (count_stored("self",106)>0){
It is better to fail and then succeed than to succeed in the first place IMG:http://i420.photobucket.com/albums/pp281/L31ch3/Userbars/Strandedgamerub.png
11.11.09 02:51:22 am
Up
JadeStone
User
Offline Off
Ok i fixed it my self by putting my brain to it if anyone wants the script i dont mind but please credit me:

     on:usesea {
          if (inarea_freshwater("unit",1)) {
          process "drinking",1000;
          drink 0,0,25,0;
          }else{
          if (count_stored("unit",1,106)>0){
          alteritem 1,106,1,499;
          msg "I filled the bottle!",4;
          speech "positive";
          }else{
          msg "I dont have a bottle!",3;
          speech "negative";
          }
     }
}
edited 1×, last 11.11.09 05:28:34 am
11.11.09 07:05:40 pm
Up
Phyire
User
Offline Off
Why doesnt this work when I 'use' on the pirate?

Spoiler >
IMG:http://miniprofile.xfire.com/bg/os/type/1/3virus3.png
12.11.09 05:39:02 am
Up
Vibhor
User
Offline Off
Phyire has written:
Why doesnt this work when I 'use' on the pirate?

Spoiler >


just putting the script wont work
you have to put an event too
like on:use
My avatar describes my personality the best....Douchebag who have to save the princess without speaking anything
12.11.09 11:20:13 pm
Up
Fubbles
User
Offline Off
Heya, i went through some of the tutorials, but couldnt seem to find anything..im making a simple island, that basically is centered on one thing; Clutter. I want a thick thick THICK jungle. Thats easy to make.

My problem is that i want the player to be able to do numerous things. I dont know if these are even probable though

After 14 game days, a plane will fly over the island and spot the player, and on Day 15 a boat (yacht) will spot the player, and take him off.

The problem is surviving these 14 days though!



The player will start off with some items, Like;

A Jar
Some Meat
Rope (well thats just handy!)
And well...thats it

So i need to know how to script these things;

Script the players starting position. Right now you just start in the middle of the island, but i placed a "Player" unit where i want the player to start, i just dont know how to make him the player...

Script the jar to be able to hold Salt water, then boil over fire into drinkable Fresh water

A person can survive for 2 weeks without food, which is what will need to be possible in this island cause its a tiny one with no predators.

Script the plane and Boat.

Soo far thats all i think ill need. The island it self is medium, so it shouldnt take that long to make it cluttered, im half done now...
13.11.09 01:56:44 am
Up
Bloodshot
User
Offline Off
You need no scripting for the player position. You select infos from the section in the editor, and find player start and place it where you want it.
It is better to fail and then succeed than to succeed in the first place IMG:http://i420.photobucket.com/albums/pp281/L31ch3/Userbars/Strandedgamerub.png
13.11.09 05:26:41 am
Up
Fubbles
User
Offline Off
Yea i figured that out right after i posted :p
17.11.09 08:46:18 pm
Up
amstel bier9
User
Offline Off
whats the script if I want to drop an item(ring)
on a building (mount doom)
that than the ring destoyed..
but if i drop on other places..
you can see it... and take it back (like normal)...
current project: seasons survivor! done: GTA lienden! done: Ultimate Survival!
To the start Previous 1 2 ... 78 79 80 ... 121 122 Next To the start