Javascript

Redd00
28 Dec 2018, 10:39

How do i add javascript in my games? The documentation is too short and i need a detailed one on how to do it


Bluevoss
02 Jan 2019, 01:05

You need to add four spaces in front of every javascript line. And it needs to go in front of all "squiffy" commands.

So, for example, some of my code:

    squiffy.set("numPath",100); 
    squiffy. randomPath ("numPath");
    
You find an old water fountain. While it smells like
{if p1=1:a rat's been pissing in it,}
{if p1=2:rust and corrosion,}
{if p1=3:something died in the splash bowl,}
{if p1=4:homeless tramps have been washing their teeth in it,}
{if p1=5:stagnant water,}
{if p1=6:pond scum,}
there is still pressure on the pipes.

Bluevoss
02 Jan 2019, 01:06

In this case, the function "Random Path" generates a p1 value between 1 and 6.


Redd00
04 Jan 2019, 11:21

Hey thanks man! It worked


sukalu88
19 Feb 2019, 01:43

thank you