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 Syntax Help, please!
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#1
Script Syntax Help, please!

I'm making a map (Just for LOLZ) and i got two scripts. One will make me waking up and another unlocking a locked door. The problem is that, these two scripts both used the
PHP Code: (Select All)
void OnStart() 
Syntax on the beggining! Any way to combined them both?!

"Veni, vidi, vici."
"I came, I saw, I conquered."
(This post was last modified: 01-29-2013, 03:25 PM by PutraenusAlivius.)
01-29-2013, 03:24 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#2
RE: Script Syntax Help, please!

You put them inside the void OnStart() ?

void OnStart()
{
//Wake up script
//Other script
}

Trying is the first step to success.
(This post was last modified: 01-29-2013, 03:36 PM by FlawlessHappiness.)
01-29-2013, 03:36 PM
Find
No Author Offline
Posting Freak

Posts: 962
Threads: 10
Joined: Jun 2012
Reputation: 13
#3
RE: Script Syntax Help, please!

(01-29-2013, 03:36 PM)BeeKayK Wrote: You put them inside the void OnStart() ?

I laughed at that for some reason.

[Image: the-cabin-in-the-woods-masked-people.jpg]
01-29-2013, 03:52 PM
Find
TheGreatCthulhu Offline
Member

Posts: 213
Threads: 10
Joined: Oct 2010
Reputation: 32
#4
RE: Script Syntax Help, please!

@OP: See this to find out more how script functions integrate with the game.
01-29-2013, 11:11 PM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#5
RE: Script Syntax Help, please!

(01-29-2013, 11:11 PM)TheGreatCthulhu Wrote: @OP: See this to find out more how script functions integrate with the game.
Thanks. Sure helped me studying the HPL Editor, but the problem still exists. How do i combined them both?

@BeeKayK, i tried that and didn't work.

"Veni, vidi, vici."
"I came, I saw, I conquered."
01-30-2013, 08:27 AM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#6
RE: Script Syntax Help, please!

Please show us your script for us to help.

Trying is the first step to success.
01-30-2013, 09:59 AM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#7
RE: Script Syntax Help, please!

(01-30-2013, 09:59 AM)BeeKayK Wrote: Please show us your script for us to help.

Don't need to. I'm rebuilding from scratch. Lock thread?

"Veni, vidi, vici."
"I came, I saw, I conquered."
01-30-2013, 10:33 AM
Find
TheGreatCthulhu Offline
Member

Posts: 213
Threads: 10
Joined: Oct 2010
Reputation: 32
#8
RE: Script Syntax Help, please!

A map script can have only one OnStart() function. Inside it (or inside OnEnter() ), between the { and }, you setup some initial stuff and some callbacks. Callbacks are just other (custom) functions in the code that will be called by the engine when some event of importance you "subscribed to" happens in the game. You'll probably want to add a player interact callback or something similar so that the door can be unlocked when the player clicks on them (or does something that should unlock them).

But, in order to combine the two scripts (or write it all from scratch), you'll have to have at least some basic understanding of how scripting works - so read some tutorials, and ask questions here.

And, please do show your code if you run into trouble; don't make us go look for our magic crystal ball so that we can see what you're doing wrong Wink.
01-30-2013, 11:11 AM
Find




Users browsing this thread: 2 Guest(s)