• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Need Help Placing stuff around/below characters

Levis

Find(Rum) = false;
Staff member
Administrator
Creative Support
Programmer
Storm Modder
Does someone know if there is a way to place a texture or something like that below the character (moving it if the character moves) I might have a nice idea but don't know if this is possible. Anyone knows some kind of system similar to this?
 
The only things I could think of is either an equipped item (of blade or gun type) or something added to the character model itself.
 
The only things I could think of is either an equipped item (of blade or gun type) or something added to the character model itself.
Do you know if we can equip more types of stuff? Any idea how it works with the positions of that model? Where do you set them?
 
The blade and gun are placed at these locators I guess. More locators can be added and new equip item type
can be made but maybe the code for making the weapons visible are in the engine?
locators.jpg
 
Do you know if we can equip more types of stuff? Any idea how it works with the positions of that model? Where do you set them?

I tried to create some kind of hunt of collectables items, added some items of caribbean fruits, too, but I am not sure about the possibility of adding another field to the struct char of the main character (or NPCs).
There is a modifiable list of equippable items?
(If someone need pictures and code of the fruits i can add them)
 
You should not need to equip items if you are just collecting them. You just need them in your inventory. Provided that the items are defined in "PROGRAM\ITEMS\initItems.c" (or in "PROGRAM\Storyline\<your story name>\items\initQuestItems.c" if you are writing a storyline and the items are only for that story), you can use these functions:
  • GiveItem2Character(character, item) - the character gets one of this item
  • TakeItemFromCharacter(character, item) - the character loses one of this item
  • TakeNItems(character, item, n) - the character gets n of this item. If n is negative then the character loses n of this item
  • CheckCharacterItem(character, item) - does this character have any of this item?
  • GetCharacterItem(character, item) - tells you how many of this item the character has
So, you've put a pineapple somewhere and the player goes there. To give a pineapple to the player:
Code:
GiveItem2Character(PChar, "pineapple");
Or perhaps you want to give the player three pineapples at once:
Code:
TakeNItems(PChar, "pineapple", 3);

Elsewhere in the code, you want to know if the player is carrying at least one pineapple:
Code:
if (CheckCharacterItem(PChar, "pineapple"))
{
 <do pineapple-related things>
}

Another way to check for items is to set up a quest trigger:
Code:
PChar.quest.got_pineapple.win_condition.l1 = "item";
PChar.quest.got_pineapple.win_condition.l1.item = "pineapple";
PChar.quest.got_pineapple.win_condition = "got_pineapple";
Now, when the character has found a pineapple, quest case "got_pineapple" will run.

You can check for several items:
Code:
PChar.quest.got_fruit.win_condition.l1 = "item";
PChar.quest.got_fruit.win_condition.l1.item = "pineapple";
PChar.quest.got_fruit.win_condition.l2 = "item";
PChar.quest.got_fruit.win_condition.l2.item = "coconut";
PChar.quest.got_fruit.win_condition.l3 = "item";
PChar.quest.got_fruit.win_condition.l3.item = "lime";
PChar.quest.got_fruit.win_condition = "got_fruit";
Now quest case "got_fruit" will run when the player has a pineapple, a coconut and a lime. (Provided, of course, that "pineapple", "coconut" and "lime" are defined in "initItems.c" or your storyline's "initQuestItems.c"!)

@Jack Rackham might be able to help here. His "Woodes Rogers" and "Goldbug" storylines involve a lot of collecting items.
 
There is a modifiable list of equippable items?
Equipable items can be visible on the character model. But only if they are of BLADE_ITEM_TYPE or GUN_ITEM_TYPE
because of post #4 above. A spyglass for ex can be equipped but remains unvisible. There are many equip item types of this kind:

if (selection == BLADE_ITEM_TYPE || selection == ARMOR_ITEM_TYPE || selection == AMMUNITION_ITEM_TYPE || selection == FLASK_ITEM_TYPE || selection == POUCH_ITEM_TYPE || selection == BELT_ITEM_TYPE || selection == OPEN_ITEM_TYPE) selection = GUN_ITEM_TYPE;
if (selection == SPYGLASS_ITEM_TYPE || selection == LOCKPICK_ITEM_TYPE || selection == CLOCK_ITEM_TYPE || selection == COMPASS_ITEM_TYPE || selection == DOCUMENT_ITEM_TYPE || selection == OUTFIT_ITEM_TYPE) selection = OBJECT_ITEM_TYPE;
if (selection == EQUIP_ITEM_TYPE || selection == EQUIP2_ITEM_TYPE || selection == EQUIP3_ITEM_TYPE || selection == EXAMINE_ITEM_TYPE) selection = QUEST_ITEM_TYPE;

Now you can fake this by making a fruit model a BLADE_ITEM_TYPE for ex. Then it will be visible. I have done this for a lot of items.
Here a flag under the arm. (BLADE_ITEM_TYPE)
2 Teach_flag.jpg

Is this what you want to know? Or was your question already answered by @GreyRoger?
 
You should not need to equip items if you are just collecting them. You just need them in your inventory. Provided that the items are defined in "PROGRAM\ITEMS\initItems.c" (or in "PROGRAM\Storyline\<your story name>\items\initQuestItems.c" if you are writing a storyline and the items are only for that story), you can use these functions:
  • GiveItem2Character(character, item) - the character gets one of this item
  • TakeItemFromCharacter(character, item) - the character loses one of this item
  • TakeNItems(character, item, n) - the character gets n of this item. If n is negative then the character loses n of this item
  • CheckCharacterItem(character, item) - does this character have any of this item?
  • GetCharacterItem(character, item) - tells you how many of this item the character has
So, you've put a pineapple somewhere and the player goes there. To give a pineapple to the player:
Code:
GiveItem2Character(PChar, "pineapple");
Or perhaps you want to give the player three pineapples at once:
Code:
TakeNItems(PChar, "pineapple", 3);

Elsewhere in the code, you want to know if the player is carrying at least one pineapple:
Code:
if (CheckCharacterItem(PChar, "pineapple"))
{
 <do pineapple-related things>
}

Another way to check for items is to set up a quest trigger:
Code:
PChar.quest.got_pineapple.win_condition.l1 = "item";
PChar.quest.got_pineapple.win_condition.l1.item = "pineapple";
PChar.quest.got_pineapple.win_condition = "got_pineapple";
Now, when the character has found a pineapple, quest case "got_pineapple" will run.

You can check for several items:
Code:
PChar.quest.got_fruit.win_condition.l1 = "item";
PChar.quest.got_fruit.win_condition.l1.item = "pineapple";
PChar.quest.got_fruit.win_condition.l2 = "item";
PChar.quest.got_fruit.win_condition.l2.item = "coconut";
PChar.quest.got_fruit.win_condition.l3 = "item";
PChar.quest.got_fruit.win_condition.l3.item = "lime";
PChar.quest.got_fruit.win_condition = "got_fruit";
Now quest case "got_fruit" will run when the player has a pineapple, a coconut and a lime. (Provided, of course, that "pineapple", "coconut" and "lime" are defined in "initItems.c" or your storyline's "initQuestItems.c"!)

@Jack Rackham might be able to help here. His "Woodes Rogers" and "Goldbug" storylines involve a lot of collecting items.
Thank you! This is just what I need.
 
What are you working on, @Baddy?
Sounds interesting. :woot

I think adding some fruits to the game would be a very healthy idea. :cheeky
 
What are you working on, @Baddy?
Sounds interesting. :woot

I think adding some fruits to the game would be a very healthy idea. :cheeky
I was intending, on landing crew can try to find some stuff. Maybe try to catch meat hunting animals or find fruits, when the ship is low on supplies.
This can be done on dialogue enc_officer, the captain order to find food on the island, fade to black, a note on hours or day passed and then an officer - or sailor - saying "we have found n rations of blablabla"...
Randomly the hunting can disturb natives, causing an attack or such, I don't know.
Meat can be trasformed in stock of food, fruit obviously in stock of fruits, maybe.
If someone thinks can be useful I can work on it.
 
Back
Top