Can we create dynamic exits at runtime? Working on a randomized dungeon crawler called Loot'n'Scoot

Lootnscoot_2022-01-27T012711.623941.zip (64.2 KB)

I'm working on my first pulp project. I've posted in two other threads on this already, but now that i can upload files it felt better to just start my own thread. sorry to anyone who sees the other two comments and responds there...

anyway, my issue is:

  1. variable store/restore is apparently performed only when switching rooms
  2. my project has just one room, randomly created at runtime, with a randomly located 'exit'
  3. i put 'exit' in quotes there because it's not a proper exit tile - i don't see any way to create proper exit tiles in pulpscript

I've attached my project here - i'm an embedded dev and approaching this through pulp/pulpscript isn't exactly in my comfort zone, so i'm likely doing a lot of stupidly silly things... feel free to educate me, i'm eager to play. in the long run i'll likely use the C SDK once it launches, but for now i'm having fun trying to use pulp :slight_smile:

Anyway my question for those more knowledgeable than myself:
Is there a way to dynamically place an exit tile via pulpscript? Alternatively is there a way to force 'store' to happen immediately rather than just queue it up to occur on the next room change?

Many thanks
-bit

1 Like

In terms of exits, there's no need to use / create one, using goto X,Y in "roomName" inside a function would do it as that'll switch the player to that location in a specified room.

As a really quick and dirty example of this, see below : only runs the function if it detects you stood on a tile (below the player) that has that function in it's script (so use an item and just override the on collect event with a blank function).


on confirm do

tell event.px,event.py to
call "function on the specific tile you want to activate"
end

end

Then the Item tile would look like:

on collect do
//do nothing
end

on SomeFunction do
goto 1,1 in "start"
end

Can't help on the store thing, sorry

1 Like

thanks - this actually fixed my store/restore issue! :smiley:

so now when my player reaches the random exit location i call on store then goto 1,1 in a room with nothing in it... in that room the 'enter' handler just sends the player back to my main room which is randomized again on entry.

problem solved. thanks again!

2 Likes

Awesome! Glad it worked mate.