Announcement: Be excellent to each other.

Caravel Forum : Caravel Boards : Development : Create something relative to Player (Few 'easy' questions)
New Topic New Poll Post Reply
Poster Message
Level: Goblin
Rank Points: 16
Registered: 08-18-2017
IP: Logged

File: Super pouvoirs.hold (7.8 KB)
Downloaded 2 times.
License: Public Domain
icon Create something relative to Player (0)  
I have some few questions :

1-Is it possible to create a wall, one tile above the player ? Except by create 31x37if, i don't saw any.

2a-What are the specificities of Puffs ?
2b-I would like to create a puff one tile above the player. Actually I just use 'Generate entity Mycharacter (0,0, northwest)' and then i move him to player, and change the var _MyX, _MyY, and _MyO, and it work.
2c-Is there a way to create two puffs : one tile above the player, and two tile above the player without creating two different characters ?

3-Let's say i want to create a puff one tile above and one tile at the right of the player (northest).
With my knowledge, i would have generate this monster in (0,0), then tp at the player, and then changed his _MyX and _MyY. But if there is a monster on _MyX+1, i think the monster will not be tped, and i have no control of what will happen after. Is there a better way to do that ?

4-There is one moment where i changed the var _O, but since the player move and 'attack' before the script, he doesn't do dommages after the change of _O... How can I resolve that ?

I let you downland the hold that I create actually in case you want check the different script :
You should start by reading General.
The script 4, 389, 78 is only a limited version of General in function of what I need for one level.
ChallengeXXX is for the challenge.
And Premier-4, Second-4, etc... Is for create 4 'wall', check level 1W for more information.

[Last edited by Romain673 at 10-15-2017 07:41 PM]
10-15-2017 at 07:23 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Level: Smitemaster
Rank Points: 902
Registered: 06-13-2015
IP: Logged
icon Re: Create something relative to Player (0)  
This should probably be in the architecture board, as it's a question more about in-game scripting than actual development of stuff for the game. Maybe someone else can weigh in on that.

At any rate, the basic answer to most of your questions is that Yes, it's Very Easy to make something relative to the player's location, using what are called Myscript injections. The way it works is this:
You can set the variables _MyScriptX, _MyScriptY dynamically (for example, set them to be _X and _Y-1 respectively to point at the location 1 tile north of the player's current position) and then use a Generate Entity or Build command, which will then have whatever x and y you enter in the command overwritten by the values of _MyScriptX and _MyScriptY. The important thing to remember while doing this is that _MyScript vars override LOTS of values (including how many turns the Wait command actually waits), so you'll want to reset them all to -9999 (the "don't override" value) immediately after you use their dynamic value, every single time. Of course, if you're trying to spawn or build something just north of the player you will need to be careful to check that it's within room bounds (not a _Y value of -1 in the above example) and not directly on top of an existing thing unless you do something like Attack Tile Kill to get rid of said thing first (but remember that some things can't be gotten rid of, such as tokens).

This is a good, but not complete, reference for what certainly values of _MyScript do to various commands. Some of the information in this thread will fill in those gaps, though it isn't all accurate to DROD because that second thread is about what Myscript does in DRODRPG, a bit of a different engine. Ultimately it's usually necessary to sometimes just test these things to figure out what does exactly what.

I'm not completely sure about the answer to question 4, but based on a certain level in Lavendar Levels I'm certain somebody at some point found a way to make the player's sword turn via scripting which also made it process a stab.

109th Skywatcher

Here are some links to Things!
Click here to view the secret text

[Last edited by Xindaris at 10-15-2017 08:31 PM]
10-15-2017 at 08:27 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : Caravel Boards : Development : Create something relative to Player (Few 'easy' questions)
Surf To:

Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us |

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.