Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

The tricky part about doing something when a card is first visited is that the "view[]" event is also fired in other situations- if a deck is saved and reloaded, if a dialog box is closed, if you switch to an editing tool and then re-enter "Interact" mode, etc.

One way to approach this would be to make the alert box triggered by whatever script is used to take the user to that card. For example, if the user clicks a button to go to a card named "tutorialized", you might give that button a script like:

on click do
 go["tutorialized"]
 alert["just so you know, ..."]
end

Another way could be to make an invisible checkbox on that card, name it "tooted", and use it to keep track of whether the tutorial has been shown. This way you can be certain it will only ever be shown once, but you may need to remember to reset it before you save the deck:

on view do
 if !tooted.value
  tooted.value:1
  alert["just so you know, ..."]
 end
end

And a third way would be to make a deck-level script that intercepts the "go[]" function used to move between cards and trigger the tutorial there if the destination card is the one we're interested in. This is rather invasive and not particularly recommended:

on go card trans delay do
 c:deck.card
 send go[card trans (30 unless delay)]
 if (!c~deck.card)&(deck.card~tutorialized)
  alert["just so you know, ..."]
 end
end

Does any of that help?