Ty ThomTHOM wrote: ↑Sat Sep 21, 2019 9:18 amCode: Select all
function champXP() for i=1,4 do local ch = party.party:getChampion(i) if ch:isAlive() then ch:gainExp(50) hudPrint(" "..ch:getName().." gained 50 XP.") end end playSound("level_up") end
Ask a simple question, get a simple answer
- Eleven Warrior
- Posts: 746
- Joined: Thu Apr 18, 2013 2:32 pm
- Location: Australia
Re: Ask a simple question, get a simple answer
- Eleven Warrior
- Posts: 746
- Joined: Thu Apr 18, 2013 2:32 pm
- Location: Australia
- Eleven Warrior
- Posts: 746
- Joined: Thu Apr 18, 2013 2:32 pm
- Location: Australia
Re: Ask a simple question, get a simple answer
How do I add the champs name to the hudPrint (below) ty.
Code: Select all
defineObject{
name = "itm_food_cheese_big",
baseObject = "base_item",
components = {
{
class = "Model",
model = "mod_assets/models/items/food/cheese_big.fbx",
},
{
class = "Item",
uiName = "Big Cheese",
gfxAtlas = "mod_assets/textures/gui/gui_icons_food.tga",
gfxIndex = 2,
weight = 0.5,
description = "Big extra tasty cheese.",
traits = { "consumable" },
},
{
class = "UsableItem",
onUseItem = function(self, champion) --- Champ 1 or 2 to 4 names show when the eat the cheese ---
hudPrint("eats the cheese")
end,
nutritionValue = 250,
},
},
tags = { "item_food" },
}
Re: Ask a simple question, get a simple answer
Code: Select all
hudPrint(champion:getName() .. " won't eat that.")
Re: Ask a simple question, get a simple answer
I've come to the point where I want to start removing default assets to lighten the load in anticipation of more custom stuff to add.
When I look at other dungeon files they simply remove the line standard_assets and then start adding a bunch of default stuff they still want to use line by line. I don't want this. (Well, not unless this is the only way)
I want to do the exact opposite if that's possible. Simply copy the entire asset pack v2 in my mod file
and then change
import "assets/scripts/standard_assets.lua"
into
import "mod_assets/assets/scripts/standard_assets.lua" (the location of the asset pack v2)
And then simply start removing the crap I don't need in that folder.
So my first question: Is this even remotely possible what I'm trying to achieve?
For example the first thing I want to exclude is the default music while keeping everything else intact.
Any advice on how to proceed?
So my 2nd question: how should my init file look like if my stupid idea is impossible to execute and for example I want everything "default assets" intact with only the default ogg sound tracks removed.
When I look at other dungeon files they simply remove the line standard_assets and then start adding a bunch of default stuff they still want to use line by line. I don't want this. (Well, not unless this is the only way)
I want to do the exact opposite if that's possible. Simply copy the entire asset pack v2 in my mod file
and then change
import "assets/scripts/standard_assets.lua"
into
import "mod_assets/assets/scripts/standard_assets.lua" (the location of the asset pack v2)
And then simply start removing the crap I don't need in that folder.
So my first question: Is this even remotely possible what I'm trying to achieve?
For example the first thing I want to exclude is the default music while keeping everything else intact.
Any advice on how to proceed?
So my 2nd question: how should my init file look like if my stupid idea is impossible to execute and for example I want everything "default assets" intact with only the default ogg sound tracks removed.
Re: Ask a simple question, get a simple answer
Any file in the folder "assets" can't be touched by you directly.
What you indeed can do ist copy the definition files from the assets pack in your mod_assets folder, set an init link to it and delete the line import "assets/scripts/standard_assets.lua" in the file mod_assets\scripts\init.lua
Then remove or modify everything you want.
I would suggest not to re-import everything you need anyway. It's done by deafult. Just use an own file for assets you want to delet or modify.
What you indeed can do ist copy the definition files from the assets pack in your mod_assets folder, set an init link to it and delete the line import "assets/scripts/standard_assets.lua" in the file mod_assets\scripts\init.lua
Then remove or modify everything you want.
I would suggest not to re-import everything you need anyway. It's done by deafult. Just use an own file for assets you want to delet or modify.
Re: Ask a simple question, get a simple answer
Is there a list somewhere with every init line of all default assets chopped up in their respective init lines?
Because I need to see this visually to understand it.
All I want for now is all default assets still active with the only exception that removes: import "assets/scripts/ambient_tracks.lua"
Edit: I just found the standard_assets notepad file. I'm beginning to understand.
Because I need to see this visually to understand it.
All I want for now is all default assets still active with the only exception that removes: import "assets/scripts/ambient_tracks.lua"
Edit: I just found the standard_assets notepad file. I'm beginning to understand.
Re: Ask a simple question, get a simple answer
Just make edits [and omissions] to a copy of the standard_assets.lua file from the asset pack, and replace the call to include it in your init file, with calling your edited copy instead.
For example, if you don't use the Tomb tile-set, then you can remove it from the edited standard_assets.lua.
For example, if you don't use the Tomb tile-set, then you can remove it from the edited standard_assets.lua.
Re: Ask a simple question, get a simple answer
Yes, that's what I finally understood. Currently I'm preparing my mod for this change. Changing all music in my maps to my custom ones before I remove the ambient line.Isaac wrote: ↑Tue Sep 24, 2019 4:15 pm Just make edits [and omissions] to a copy of the standard_assets.lua file from the asset pack, and replace the call to include it in your init file, with calling your edited copy instead.
For example, if you don't use the Tomb tile-set, then you can remove it from the edited standard_assets.lua.
Re: Ask a simple question, get a simple answer
Code: Select all
-- import standard assets
import "mod_assets/scripts/standard_assets.lua"
import "assets/scripts/objects/base.lua"
import "assets/scripts/objects/generic.lua"
import "assets/scripts/spells/blob.lua"
import "assets/scripts/monsters/skeleton_knight_trooper.lua"
import "assets/scripts/monsters/uggardian.lua"
I copied the standard assets notepad file into my script folder.
I removed the ambient track line in the copied "standard_assets.lua" notepad file
And I called the modded standard_assets.lua instead of the default one.
I start up the dungeon editor. I load up my mod and I'm still able to select the default ambient tracks like forest and lindworm /undead etc... default ambient tracks and they play just fine.
What am I doing wrong?