Author Topic: Questions about DC  (Read 14874 times)

Offline Milos Gulan

  • Hero Member
  • *****
  • Posts: 3134
Re: Questions about DC
« Reply #165 on: March 28, 2017, 02:43:41 PM »
Ok that will work but I have opened and tried to edit potion but it will be har for me to figure out how to this what I need.

I would like to have both items (food) that heal one person and those that heal all party members. They should heal from 1 to 4 points. For examle drink and drinks should heal 1 HP, bread or breads 2, ect up to 4.

Can You please help me with scripting this time, I am not in hurry to get it but now I am a bit busy and don't have time to learn it that good to do it myself I know I should start learning it :)

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9815
Re: Questions about DC
« Reply #166 on: March 28, 2017, 03:12:18 PM »
I don't know what more to say...I gave you an example that you literally only need to cahnge one thing.
For your first kind of food, you just need to cahnge the name! For your second, you just need to change the targeting type of the spell.

I don't mind helping, but I'm not going to do it for you. ;) I know you can do this, because you have done many things already that are far more complicated.

Offline Milos Gulan

  • Hero Member
  • *****
  • Posts: 3134
Re: Questions about DC
« Reply #167 on: March 29, 2017, 02:35:38 AM »
Ok, I will try. It just look a bit complicated. Thanks for the info.

Offline Milos Gulan

  • Hero Member
  • *****
  • Posts: 3134
Re: Questions about DC
« Reply #168 on: March 29, 2017, 07:32:50 AM »
Ok here is what I have done in GPDL script. I have copied potion in item editor and edited it a bit, in brackets I have included my comments, it works partialy with exceptions described in brackets. Also I don't know how to change command word for usage to show Eat instead of Drink:

$VAR char;
$VAR rndm;
char = $MyIndex();
rndm = $RANDOM(4) +# $RANDOM(4) +# 4; (I am not sure what is this, does it mean roll d4 + roll d4 and #4 (not sure what is this)

$IF ($GET_CHAR_Ready($Myself(), "WEAPON", 0) != "Meat"){$RETURN;};
$TAKE_CHAR_ITEM($Myself(),"Meat");
$GIVE_CHAR_ITEM($Myself(),"Meat Leftovers"); (this should be posted after drinking, but it doesn't show up, I am not sure where is mistake)

$SET_CHAR_HITPOINTS(char, $GET_CHAR_HITPOINTS(char) +# rndm);
$IF ($GET_CHAR_HITPOINTS(char) ># $GET_CHAR_MAXHITPOINTS(char))
   {
      $SET_CHAR_HITPOINTS(char,$GET_CHAR_MAXHITPOINTS(char));
   };
« Last Edit: March 29, 2017, 07:35:34 AM by Milos Gulan »

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9815
Re: Questions about DC
« Reply #169 on: March 29, 2017, 01:15:48 PM »
Isn't this a bit like your car won't start, so the first thing you do is take apart the carburator?

Did you do what I suggested in my earlier post? Make a copy of the Potion of Healing and rename it Meat? Did it work?

As for the GPDL script, when you say modified the potion's script, what do you mean? Changed the name of one item to that of another item? Or did you actually change the script in another way?

To change "Drink" to "Eat", you need to look at your item in the Item Editor. The option is in the lower right quadrant of the editor.

Offline Dinonykos

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2332
    • Dinonykos Dungeon Craft
Re: Questions about DC
« Reply #170 on: March 29, 2017, 01:50:45 PM »
I don't want to interrupt you two, but following this, I checked the healing potion. I assume that both "EAT" and "DRINK" are just modifications of the "EXAMINE" text? If so, does the potion (or Milos' food) also work in combat?

As for the GPDL script, when you say modified the potion's script, what do you mean? Changed the name of one item to that of another item? Or did you actually change the script in another way?
Well, to me it looks like Milos changed
Code: [Select]
$TAKE_CHAR_ITEM($Myself(),"Potion");
$GIVE_CHAR_ITEM($Myself(),"Empty Bottle");
to
Code: [Select]
$TAKE_CHAR_ITEM($Myself(),"Meat");
$GIVE_CHAR_ITEM($Myself(),"Meat Leftovers");
... Which is probably a wise step, otherwise, the meat would remain in the backpack and maybe magically generate an empty bottle, right?

Milos, I assume you have also created an item named "Meat Leftovers"? Otherwise, I guess it is no surprise that the leftovers do not show up...

« Last Edit: March 29, 2017, 01:53:04 PM by Dinonykos »
Find four contributions to the Pre-Generated Character Mini-Module Design Contest on my homepage.
New: THE AMBASSADOR'S LETTER, my contribution to the 7-day-challenge.
DINONYKOS DUNGEON CRAFT DESIGN HOMEPAGE

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9815
Re: Questions about DC
« Reply #171 on: March 29, 2017, 02:26:23 PM »
:D

I can see what was changed in the script, but if he didn't actually create new items (which he never stated), it won't matter.

He asked for help, and I suggested starting with A, B, C, and he answered with P, Q, R. I don't know if he did the first things, and if he didn't, the latter things won't work. ;)

Offline Milos Gulan

  • Hero Member
  • *****
  • Posts: 3134
Re: Questions about DC
« Reply #172 on: March 29, 2017, 02:31:49 PM »
It didnt worked at start because it was adressed to item potion and I needed to change it in script in meat.

I can't make it work by changing the examine option, it still says Drink instead of Eat that I have changed.

But is ok, if it is too much trouble I can try to figure it out later eventualy but I wan't to know how to change number of HPs. I guess that is done here

rndm = $RANDOM(4) +# $RANDOM(4) +# 4; (I am not sure what is this, does it mean roll d4 + roll d4 and #4 (not sure what is this)

Thanks Dynonikos You are right I would need to make another item named Meat leftovers or Bones but I will not do that now maybe later. And You are right that is the part that I have changed. Here is the full script of item Potion (full name in editor Potion of healing). I really need to faimiliarize with this scripts, I think I should read databases.

$VAR char;
$VAR rndm;
char = $MyIndex();
rndm = $RANDOM(4) +# $RANDOM(4) +# 4;

$IF ($GET_CHAR_Ready($Myself(), "WEAPON", 0) != "Potion"){$RETURN;};
$TAKE_CHAR_ITEM($Myself(),"Potion");
$GIVE_CHAR_ITEM($Myself(),"Empty Bottle");

$SET_CHAR_HITPOINTS(char, $GET_CHAR_HITPOINTS(char) +# rndm);
$IF ($GET_CHAR_HITPOINTS(char) ># $GET_CHAR_MAXHITPOINTS(char))
   {
      $SET_CHAR_HITPOINTS(char,$GET_CHAR_MAXHITPOINTS(char));
   };

Edit: to the last post of Manikus that was done while I was typing.

I created Meat item and then copied over it Potion item. It didn't worked because in the script it stated Potion and when I changed it to meat it worked.
« Last Edit: March 29, 2017, 02:36:04 PM by Milos Gulan »

Offline Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2232
Re: Questions about DC
« Reply #173 on: March 29, 2017, 06:49:25 PM »
A small thing, perhaps:  I thought $RANDOM(4) would return
values 0 through 3.  If so:

$RANDOM(4) +# RANDOM(4) +# 4

would be

2D4 + 2

Offline Dinonykos

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2332
    • Dinonykos Dungeon Craft
Re: Questions about DC
« Reply #174 on: April 01, 2017, 01:49:37 AM »
I have one question that might fit here:
Let's say I make an item in the item editor, give it to a pre-made NPC, then go back to the item editor and change the properties of the item: Would the item the NPC has also be automatically changed, or is it stored elsewhere in the NPC-related data and would thus not change? In my impression it is the latter...
« Last Edit: April 01, 2017, 02:57:17 AM by Dinonykos »
Find four contributions to the Pre-Generated Character Mini-Module Design Contest on my homepage.
New: THE AMBASSADOR'S LETTER, my contribution to the 7-day-challenge.
DINONYKOS DUNGEON CRAFT DESIGN HOMEPAGE

Offline Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2232
Re: Questions about DC
« Reply #175 on: April 01, 2017, 11:08:44 AM »
Let us call items that are available in the database: "Items".
Let us call items in the possession of a character "Possessions"/

In general:
Properties that can change during gameplay are associated
with the "possession".  Immutable properties are associated
with the "item".

Here is a list of properties of "Possessions":
Code: [Select]
int key;
 ITEM_ID itemID; // was GLOBAL_ITEM_ID m_giID;  // exactly one int in size.
 int ready;
 int qty;
 int identified;
 int charges;
 BYTE cursed;
  // how much was paid for item (important for selling)
  // -1 means not purchased, use base item cost in database
 int paid;
 bool m_scriptProcessed;

All other properties are determined by looking up the "item_ID in
the "items' database.  Those properties can be changed in the editor.

Offline Milos Gulan

  • Hero Member
  • *****
  • Posts: 3134
Re: Questions about DC
« Reply #176 on: April 02, 2017, 06:15:18 AM »
Thanks for the answer, it really helps, I need to get into it. Was a bit busy lately as my group is not giving up on playing but I will try to continue on my work.

Offline Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2232
Re: Questions about DC
« Reply #177 on: April 02, 2017, 09:16:49 AM »
Quote from: Milos Gulan
I will try to continue on my work.

I am looking forward to seeing the results.

Offline Milos Gulan

  • Hero Member
  • *****
  • Posts: 3134
Re: Questions about DC
« Reply #178 on: April 03, 2017, 03:35:44 AM »
I will try :) Here is what I have been doing lately, this sunday that is. I think it looks nice only that I have forgot to put lights in the scene :/ https://www.daz3d.com/gallery/images/334081/

Good news is that I have got Castle Creator and that I will be able to make most of the town in 3d. Now I will need to work on it. This was just a try to make a scene with it and I tried to make a guardian of the well which probably will add soon to my module.

And yes for scripting I really need to learn it good. This was really good method to first try to solve the problem then to search for solution before asking. I think I will have to familiarize more with available tutorials and documentation before everything else.

Now I plan to draw in my notebook paths to forest for my module before making addition to it. I like how it is going, and I hope I will be able to make a nice town scene and lots of adventures and also NPCs of various levels. Will have to work on it. Thanks for the help btw :)
« Last Edit: April 03, 2017, 05:26:27 AM by Milos Gulan »

Offline Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2232
Re: Questions about DC
« Reply #179 on: April 03, 2017, 09:40:24 AM »
It sounds like a massive creation.  I hope you can finish it
while we are all still around to enjoy it.  I'm 77 years old and
starting to wonder if I will make it.