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
Question about basic scripting.
Emiel97 Offline
Junior Member

Posts: 4
Threads: 2
Joined: Mar 2015
Reputation: 0
#3
RE: Question about basic scripting.

(03-11-2015, 09:02 PM)FlawlessHappiness Wrote: Well you see. There can't be 2 functions called "OnStart".

So what you have to do with the void OnStart() is to combine them.
Like this:

PHP Code: (Select All)
void OnStart()

GiveItemFromFile("lantern""lantern.ent");
for(
int i=0;i10;i++) GiveItemFromFile("tinderbox_"+i"tinderbox.ent"); 

AddUseItemCallback("""key_1""locked_door1""UsedKeyOnDoor"true);
SetEntityCallbackFunc("key_1""OnPickup");


Makes sense, hmm?

Always remember: There cannot be 2 functions with the same name.

I've only skimmed over the other functions, as the OnStart seemed the most obvious.
Try it out, and see if it works.

If it doesn't, please return here, and explain what happens.

If you get an error, show it to us.
If you get something else, show it.




Hey,

The game doesn't crash, but it also doesn't fully work. What's supposed to happen is:

1: When player starts the map, he will start with a Lantern and 10 Tinderboxes (works).

2: When player picks up a key, a Monster spawns (doesn't work).



EDIT: The "Monster spawn" script works when i start the document with that code. But then "1" won't do anything anymore (still no crash, gets completely ignored).
(This post was last modified: 03-11-2015, 09:47 PM by Emiel97.)
03-11-2015, 09:42 PM
Find


Messages In This Thread
Question about basic scripting. - by Emiel97 - 03-11-2015, 08:56 PM
RE: Question about basic scripting. - by Emiel97 - 03-11-2015, 09:42 PM
RE: Question about basic scripting. - by Emiel97 - 03-11-2015, 10:22 PM



Users browsing this thread: 1 Guest(s)