DRL > Modding
A couple questions
tehtmi:
--- Quote from: SPTX on April 04, 2013, 09:53 ---I have this :
...
However the procedures aren't executed when chosen. What am I doing wrong?
--- End quote ---
This isn't working because you aren't storing the return value of the function call, you are comparing the function itself.
--- Quote ---I tried with
--- Code: ---if ui.msg_choice("Do you want to become a Lost Soul(S) or a Former Human(H)?","SH") == "S" then player.eq[SLOT_WEAPON] = "SPTXlostsoul"
--- End code ---
--- End quote ---
This is working for me (although there is no end statement). Are you sure it isn't something else that is wrong?
SPTX:
--- Quote from: tehtmi on April 04, 2013, 20:52 ---This isn't working because you aren't storing the return value of the function call, you are comparing the function itself.
This is working for me (although there is no end statement). Are you sure it isn't something else that is wrong?
--- End quote ---
I just tried again and it worked, can't tell what I did wrong the first time since I erased it. However since I use "if" I have to print the text twice (and make the choice twice) which makes the use of msg_choice useless compared to msg_confirm.
I'll use this until I can figure out something more... elegant.
Speaking of it, I don't seehow to return the value from the function call after calling it.
--- Quote from: shark20061 on April 04, 2013, 20:35 ---Use "@<" to make the text bolder and "@>" to stop bolding.
--- Code: ---"Do you want to become a Lost @<S@>oul or a Former @<H@>uman?"
--- End code ---
--- End quote ---
Wonderful, thanks. How come I didn't find anything about it on the internet, is it exclusive to the Pascal engine?
Side question : I'll need to check which weapon has been equipped later-on. How do?
tehtmi:
--- Quote from: SPTX on April 05, 2013, 02:48 ---Speaking of it, I don't seehow to return the value from the function call after calling it.
--- End quote ---
This is probably what you want:
--- Code: ---function Repercussions.OnLoaded()
local choice = ui.msg_choice("Do you want to become a Lost Soul(S) or a Former Human(H)?","SH")
if choice == "S" then
player.eq.weapon = "SPTXlostsoul" -- SLOT_WEAPON works as well, but this is the more standard way
elseif choice == "H" then
player.eq.weapon = "SPTXformerhuman"
end
end
--- End code ---
--- Quote ---How come I didn't find anything about it on the internet, is it exclusive to the Pascal engine?
--- End quote ---
I believe this is valkyrie (the chaosforge-roguelike-pascal library) specific. P.S. there are codes to switch to any color http://doom.chaosforge.org/wiki/Modding:Color
--- Quote ---Side question : I'll need to check which weapon has been equipped later-on. How do?
--- End quote ---
Example
--- Code: ----- make sure the player has a weapon at all (will be nil if nothing is equipped)
if player.eq.weapon then
if player.eq.weapon.id == "SPTXlostsoul" then
do_one_thing()
elseif player.eq.weapon.id == "SPTXformerhuman" then
do_another_thing()
end
end
--- End code ---
SPTX:
Perfect, thanks.
Now about these melee attacks I talked about earlier (maybe not ITT). How are they called by the game? I am talking about the melee attacks or non-melee monsters and the player when he has a weapon equipped. When bumping into other beings.
I basically need to change the default 1d3 given by fists.
Do fists have an ID? "fists" or items.fists doesn't seem to work.
Equality:
What are proper sizes of properties variables?
From wiki,
armor
durability
ammo
ammomax
res_bullet (and res_melee and so on)
movemod, knockmod and (undocumented) dodgemod
all are integers. Far from it! When created a new instance of item object,
armor - byte
durability - word
ammo, ammomax - word
resistances, movemod, knockmod - signed doubleword
well, for most cases no matter what is it - from 0 to 250 quite enough. But what about level depth? danger level? Hp and hpmax? Who knows?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version