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
Scripting question
Alexander Offline
Junior Member

Posts: 22
Threads: 2
Joined: Sep 2010
Reputation: 0
#1
Scripting question

Could someone explain what
(string &in asParent, string &in asChild, int alState) means. Surprisingly I have been writing my own code, even though I don't actually understand it. So what exactly is "string &in asParent" etc... I have an idea of what it might be, but I still can't grasp it.
10-06-2010, 07:12 PM
Find
HakePT Offline
Junior Member

Posts: 49
Threads: 1
Joined: Sep 2010
Reputation: 0
#2
RE: Scripting question

(string &in asParent, string &in asChild, int alState)

These are the parameters of a function. A function receives parameters and does something with them.

Void functionadd(int a, int b, int x) /// int describes the type of data in this case integer or a normal number, "a", "x" and "b" are the names of the numbers)
{
x=a+b; //adds "a" and "b" and places that value in "x"
}

If for example you called: "functionadd(5,4,x);"
x would become 9.

So basically your function receives 3 parameters:
string &in asParent //a text that identifies the parent ("player" for example) | string==text
string &in asChild //a text that identifies the child ("key1" for example)
int alState //a number that identifies the state (state "1","2", etc) | int==number
As to what the function does depends on the description. Probably something to change the parent or the child when they interact/collide.
10-06-2010, 07:34 PM
Find
Frontcannon Offline
Senior Member

Posts: 538
Threads: 10
Joined: Jul 2010
Reputation: 2
#3
RE: Scripting question

(10-06-2010, 07:34 PM)HakePT Wrote: (string &in asParent, string &in asChild, int alState)

These are the parameters of a function. A function receives parameters and does something with them.

Void functionadd(int a, int b, int x) /// int describes the type of data in this case integer or a normal number, "a", "x" and "b" are the names of the numbers)
{
x=a+b; //adds "a" and "b" and places that value in "x"
}

If for example you called: "functionadd(5,4,x);"
x would become 9.

So basically your function receives 3 parameters:
string &in asParent //a text that identifies the parent ("player" for example) | string==text
string &in asChild //a text that identifies the child ("key1" for example)
int alState //a number that identifies the state (state "1","2", etc) | int==number
As to what the function does depends on the description. Probably something to change the parent or the child when they interact/collide.

I really think we need a tutorial for this syntax-related stuff, beginners will love it!


╔═════════════════╗
☺ Smoke weed everyday ☺
╚═════════════════╝
10-06-2010, 07:42 PM
Find
Alexander Offline
Junior Member

Posts: 22
Threads: 2
Joined: Sep 2010
Reputation: 0
#4
RE: Scripting question

(10-06-2010, 07:34 PM)HakePT Wrote: (string &in asParent, string &in asChild, int alState)

These are the parameters of a function. A function receives parameters and does something with them.

Void functionadd(int a, int b, int x) /// int describes the type of data in this case integer or a normal number, "a", "x" and "b" are the names of the numbers)
{
x=a+b; //adds "a" and "b" and places that value in "x"
}

If for example you called: "functionadd(5,4,x);"
x would become 9.

So basically your function receives 3 parameters:
string &in asParent //a text that identifies the parent ("player" for example) | string==text
string &in asChild //a text that identifies the child ("key1" for example)
int alState //a number that identifies the state (state "1","2", etc) | int==number
As to what the function does depends on the description. Probably something to change the parent or the child when they interact/collide.

Thanks Smile

And off topic.. Did anyone else see what Frictional named the brutes in 15_prison_south..

"im_in_a_bad_mood"
"im_just_cute_and_happy"

xD
10-06-2010, 07:54 PM
Find
einfrnirdyr Offline
Junior Member

Posts: 30
Threads: 7
Joined: Sep 2010
Reputation: 0
#5
RE: Scripting question

Tutorials for this stuff..? Yes please!

Such an endeavour would be greatly appreciated.

Especially if such tutorials were accompanied by simple sample maps and scripts that aren't overwhelmed with detail and are straight to the point. Say, for example, a simple box map containing just a locked door and a key; accompanied with a script that demonstrates how the key is picked up and placed into the inventory and then used to open the door.
10-06-2010, 11:16 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#6
RE: Scripting question

You can't really make your game scary if you don't know how to script... maybe they are just waiting for you guys to actually make your places and then to get the scripting tutorials... I'd love it to see some more video tutorials.

10-07-2010, 10:41 PM
Find
Blackhand Offline
Junior Member

Posts: 25
Threads: 1
Joined: Sep 2010
Reputation: 0
#7
RE: Scripting question

I would really like a decent API =) At the moment I use quite a bit of trial and error to understand exactly how some of the internal functions behave.
10-08-2010, 01:03 PM
Find
DamnNoHtml Offline
Senior Member

Posts: 469
Threads: 34
Joined: Sep 2010
Reputation: 16
#8
RE: Scripting question

If you want tutorials, you pretty much need to learn C++. The language is pretty much the same. Then, all you have to do is use the functions given by the engine.

Creator of Wake, Through the Portal, Insomnia, and Cycles What to do with HPL3....
10-11-2010, 06:14 AM
Find




Users browsing this thread: 1 Guest(s)