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
Syntax on the beggining! Any way to combined them both?!
You put them inside the void OnStart() ?
Code:
void OnStart()
{
//Wake up script
//Other script
}
(01-29-2013, 03:36 PM)BeeKayK Wrote: [ -> ]You put them inside the void OnStart() ?
I laughed at that for some reason.
@OP: See
this to find out more how script functions integrate with the game.
(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.
Please show us your script for us to help.
(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?
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

.