Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Script help
Wapez Offline
Senior Member

Posts: 360
Threads: 37
Joined: Mar 2012
Reputation: 19
#7
RE: Script help

Question 1:
The solution to this is using a "for loop". That's a script that involves alot of entities, in one line of code. Like this:

Let's say you have added 50 books. You add a "for loop" that involves the numbers 1-50. The integer (shortened "i") is every number between 1 and 50.

PHP Code: (Select All)
for(int i=1;i<50;i++) 

Now we need to add a function.

PHP Code: (Select All)
AddEntityCollideCallback("Book_"+i"ScriptArea""YourFunction"true1); 


Take a look at the AddEntityCollideCallback. Instead of using the name ("Book_1") we added ("Book"+i). And since the "for loop" made the "i" mean any number between 1 and 50, every book that is named ("Book_" and a number between 1 and 50 after the underscore) will call the function "YourFunction" when they collide with the "ScriptArea".

At the end, after adding opening and closing brackets, it should look like this:

for(int i=1;i<50;i++){
AddEntityCollideCallback("Book_"+i, "ScriptArea", "YourFunction", true, 1);
}

Question 2:
The solution to this is the un-check the "Active" check-box in your ladder area, in the editor. That makes it unable to use. After that, you simple need to activate it with this script:

PHP Code: (Select All)
SetEntityActive("LadderArea"true); 


Put that in the script function when they use the rope on the hole.

Question 3:
You can use this script:

PHP Code: (Select All)
ChangePlayerStateToNormal(); 

It will make the player drop the item he is holding. Just copy the line and add it to your function.

Founder & Legally Accountable Publisher of Red Line Games.
Environment & Gameplay Designer and Scripter.
http://moddb.com/mods/in-lucys-eyes
(This post was last modified: 09-14-2012, 02:48 PM by Wapez.)
09-14-2012, 02:33 PM
Find


Messages In This Thread
Script help - by Vasco - 09-14-2012, 12:59 PM
RE: Script help - by Robby - 09-14-2012, 01:01 PM
RE: Script help - by Vasco - 09-14-2012, 01:32 PM
RE: Script help - by Robby - 09-14-2012, 01:35 PM
RE: Script help - by FlawlessHappiness - 09-14-2012, 01:39 PM
RE: Script help - by Robby - 09-14-2012, 01:40 PM
RE: Script help - by Wapez - 09-14-2012, 02:33 PM
RE: Script help - by Vasco - 09-14-2012, 04:01 PM



Users browsing this thread: 1 Guest(s)