Announcement: Be excellent to each other.


Caravel Forum : DROD RPG Boards : RPG Architecture : Various scripting questions
1
Page 2 of 2
New Topic New Poll Post Reply
Poster Message
kieranmillar
Level: Smitemaster
Rank Points: 2670
Registered: 07-11-2014
IP: Logged
icon Re: Various scripting questions (+2)  
By the way I never saw the edits to your last post until the most recent post as I had seen it pre-edit and did not know there were more questions.

Aquitanius wrote: But I'm too lazy to write up the code. You copy your code directly from the game, right? I can insert it with ctrl+shift+b. But how do you copy it to your windows clipboard? I tried ctrl+shift+c and ctrl+c. Both don't do it. Couldn't find it by searching in this forum either.

You use Ctrl + C to copy the commands as text to your clipboard, but you first need to select all of the commands you want to copy by clicking the first one, holding shift, then clicking the last one. That will select all of them.

Aquitanius wrote: Aaaand... I still have another question: How do the behaviour movement commands work? They don't seem to do anything on their own. If I want to emulate moving towards the player I could use my code and change it around a little and not put it into each defend. But that seems a little too complicated when there are movement commands already in the editor. Thanks. :D

If you ask the monster to move to a particular square using the Move command, it will behave according to the movement behaviour you gave it. So if you want it to move to a certain square and actually pathfind to that square instead of getting stuck behind a wall, you should give it a pathfinding movement behaviour, etc.

Aquitanius wrote: EDIT2: kieran, I have two questions about your burnOrder script.

1) It doesn't work if I set it up in a different NPC and let the Aumtlich just check if the burnorder is 4. It does work if it is in the Aumtlich script itself. Why?

Without seeing your code its hard to say, but if you're checking for the variable to be 4, make sure that the variable check is happening inside the loop but idependently to the other if statements. Alternatively, when the code changes the variable from a value of 3 to 4, just put the code you want to execute right there, you don't really need to add a check if the variable has reached 4 or not.

Aquitanius wrote: 2) Also if I want to Aumtlich that behave this way, they need two seperate burnOrder variables. I guess it's just because the first Aumtlich sets the burnOrder correctly to 1, but then the second one checks the wrong condition, because the burnOrder is now 1 and resets it to 0. That should be the explanation, right?

Yeah if you have multiple character scripts in the room then they will run one after the other. If you ran the burnOrder script twice in a single turn then it would never work properly as it would always reset to zero immediately after incrementing the variable because the variable will be at a different value the second time it performs the check, and so would reset it back to zero.

[Last edited by kieranmillar at 06-08-2016 07:39 PM]
06-08-2016 at 07:38 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
kieranmillar
Level: Smitemaster
Rank Points: 2670
Registered: 07-11-2014
IP: Logged
icon Re: Various scripting questions (0)  
Aquitanius wrote:
Uhm. Also I used the script given in the Architectural Handbook for the inventory. One to one. And it doesn't work. The cmd button doesn't ungrey and I cannot click it. What am I doing wrong here?
For reference, this is the code:
Click here to view the secret text

You assign scripts to the command key as though they were pieces of equipment. If you check the Equipment command you will see there are 4 slots, sword, shield, accessory and command. You need to "Equip" the command "slot" with the script that you want to trigger when you use the command key.

Note that it's not a real piece of equipment and its only purpose is to trigger an Each Use command. Trying to give it stats and behaviours like a normal piece of equipment won't do anything.
06-08-2016 at 07:41 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Aquitanius
Level: Goblin
Rank Points: 27
Registered: 05-27-2016
IP: Logged
icon Re: Various scripting questions (+2)  
kieranmillar wrote:
By the way I never saw the edits to your last post until the most recent post as I had seen it pre-edit and did not know there were more questions.

Sorry, I should probably make new posts with new questions and not edit them in. I just didn't want to spam.

You use Ctrl + C to copy the commands as text to your clipboard, but you first need to select all of the commands you want to copy by clicking the first one, holding shift, then clicking the last one. That will select all of them.

Yes, I do that all the time ingame. But it will only copy and paste inside the game. Outside of the game nothing gets copied into my clipboard. I cannot ctrl+c something from the game to this forum e.g.
Maybe it's a problem with Windows 10? The game also defaults to the left corner at startup so that I cannot drag it around. Have to alt+space to get to the drag menu every time.

If you ask the monster to move to a particular square using the Move command, it will behave according to the movement behaviour you gave it. So if you want it to move to a certain square and actually pathfind to that square instead of getting stuck behind a wall, you should give it a pathfinding movement behaviour, etc.

Ah, thank you. That makes sense.


Without seeing your code its hard to say, but if you're checking for the variable to be 4, make sure that the variable check is happening inside the loop but idependently to the other if statements. Alternatively, when the code changes the variable from a value of 3 to 4, just put the code you want to execute right there, you don't really need to add a check if the variable has reached 4 or not.

The code is exactly as you gave it, put into a seperate NPC. And in the Aumtlich script: If wait until var burnorder = 4 disappear.
But I did already make it work by putting the disappear directly into the last loop.

You assign scripts to the command key as though they were pieces of equipment. If you check the Equipment command you will see there are 4 slots, sword, shield, accessory and command. You need to "Equip" the command "slot" with the script that you want to trigger when you use the command key.

Oh, ok. That makes sense. Didn't see that before. Maybe that should be included in the Architectual Handbook. I don't think it's that obvious...

Note that it's not a real piece of equipment and its only purpose is to trigger an Each Use command. Trying to give it stats and behaviours like a normal piece of equipment won't do anything.

That would be too good to be true.

Thank you very much again for helping. :)
06-09-2016 at 03:21 AM
View Profile Send Private Message to User Show all user's posts Quote Reply
Someone Else
Level: Smitemaster
Avatar
Rank Points: 1300
Registered: 06-14-2005
IP: Logged
icon Re: Various scripting questions (+2)  
Try Ctrl-B and Ctrl-Shift-B for copying/pasting in and out of the game (I can't recall which is which).
06-10-2016 at 06:09 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Aquitanius
Level: Goblin
Rank Points: 27
Registered: 05-27-2016
IP: Logged
icon Re: Various scripting questions (+1)  
Oh, ctrl+b works. Thanks!
06-10-2016 at 04:44 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
Aquitanius
Level: Goblin
Rank Points: 27
Registered: 05-27-2016
IP: Logged
icon Re: Various scripting questions (+1)  
I just encountered a behaviour I don't really know to fix. I think I don't know enough about equipments.
Here are two similar accessories I have. The second is just an "upgrade" of the first:
Shell (+10)
  Set var "_AccessoryDEF" = 10
  Set var "_MyColor" = 9999
  Wait for player to touch me 
  Equipment 0,3,20023
  Disappear 

Shell (+22)
  Set var "_AccessoryDEF" = 22
  Set var "_MyColor" = 9999
  Wait for player to touch me 
  Equipment 0,3,20024
  Disappear 

However when I walk into the room containing the second Accessory, the variable _AccessoryDEF updates to 22.

Am I doing the accessory wrong? If not: Is there a way to prevent this happening?
06-10-2016 at 11:07 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
kieranmillar
Level: Smitemaster
Rank Points: 2670
Registered: 07-11-2014
IP: Logged
icon Re: Various scripting questions (+2)  
If you want to create some placeable equipment in the room you do not place the character directly in the room, right now it is being ran like a normal character. Want you want to do is instead make another character with the same sprite, and give it some code like the following (posted from my tablet so this will not be directly copy-pastable)

Disappear
Imperative ghost display
Wait for player to touch me
Imperative no ghost display
Equipment accessory swap Shell

Note that if the equipment is a sword, you have to make a separate image that contains only the "neutral" sprite to make it look right
06-11-2016 at 08:07 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Aquitanius
Level: Goblin
Rank Points: 27
Registered: 05-27-2016
IP: Logged
icon Re: Various scripting questions (0)  
Thank you again. This works, but brings up two related questions:

1) The Ghost display cannot be clicked on. It just shows the other stuff in the position. So with custom equipment you don't actually know what it is. I could just plant a scroll in the room to explain or make the player say something, but is there a more elegant solution?

2)
Note that if the equipment is a sword, you have to make a separate image that contains only the "neutral" sprite to make it look right
Can you elaborate on this? How is this done?
How do I give custom sprites anyway? Would be pretty cool to use a custom sprite for the player character.
(E.g. switch color (aka player character) by obtaining equipment.)
06-12-2016 at 02:50 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
kieranmillar
Level: Smitemaster
Rank Points: 2670
Registered: 07-11-2014
IP: Logged

File: beginners sword.png (1.5 KB)
Downloaded 145 times.
License: Public Domain
icon Re: Various scripting questions (+3)  
Aquitanius wrote: 1) The Ghost display cannot be clicked on. It just shows the other stuff in the position. So with custom equipment you don't actually know what it is. I could just plant a scroll in the room to explain or make the player say something, but is there a more elegant solution?
Unfortunately there is nothing you can do. A character is solid unless you make it disappear and then make it show up with ghost display, but doing this makes it unable to be right-clicked. There is also no way to just have the custom equipment start laying on the floor.

Aquitanius wrote: 2)
Note that if the equipment is a sword, you have to make a separate image that contains only the "neutral" sprite to make it look right
Can you elaborate on this? How is this done?
How do I give custom sprites anyway? Would be pretty cool to use a custom sprite for the player character.
(E.g. switch color (aka player character) by obtaining equipment.)
On the character management screen where you add characters there is a button "custom tiles" which lets you upload an image for the character to use. For shields, accessories and other non-rotating stuff this is just a 44x44 png file with 255,0,255 designating transparency.

For rotational items you want a 352x44 image showing all 8 rotations, starting North and then going clockwise.

For swords you need a ninth image on the end (so 396x44) showing the sword in a "neutral" position which is used for when it is on the floor or equipped, like so:


06-12-2016 at 10:13 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
kieranmillar
Level: Smitemaster
Rank Points: 2670
Registered: 07-11-2014
IP: Logged

File: beginners sword neutral.png (399 bytes)
Downloaded 141 times.
License: Public Domain
icon Re: Various scripting questions (+2)  
But, if you want your custom sword to start in the room you have to use the aforementioned invisible character with ghost image, in which case you'll need to make another file that is just the neutral sprite on its own to give to the character that will give you the sword when you step on it, something like this:



If you want to change how the player looks when he picks up equipment, you'll need to make separate characters each with their own sprite set, then use the Player Role command to swap between them.

(Oh, also, before I forget, if you are making sprites for a character that can wield a sword, you need to provide both unarmed and armed sprites, in a 352x88 image. I can't remember right now if the unarmed images go on the top row or the bottom row.)
06-12-2016 at 10:16 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Aquitanius
Level: Goblin
Rank Points: 27
Registered: 05-27-2016
IP: Logged
icon Re: Various scripting questions (+2)  
Again, thank you very much. :)
06-12-2016 at 11:32 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
1
Page 2 of 2
New Topic New Poll Post Reply
Caravel Forum : DROD RPG Boards : RPG Architecture : Various scripting 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 | CaravelGames.com

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