Chaosforge Forum

  • April 17, 2024, 03:42
  • Welcome, Guest
Please login or register.

Login with username, password and session length

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - tehtmi

Pages: 1 [2] 3 4 ... 25
Modding / Re: Changing the ammo system?
« on: April 04, 2013, 20:56 »
Although I've set the weight of all the normal doomRL enemies to zero, the game is still generating special rooms full of lost souls, and it also seems to be generating imps on some levels. Is there any easy way to stop this?

There are a variety of reasons that enemies will spawn even with 0 weight.  I can think of:
1) being_groups (this is probably giving you those imps); these have weights that can be zeroed
2) vault rooms (this is the room with lost souls probably); I think you can set the weight of this room type to 0 with the new generator stuff
3) some level types (like caves) will pick a being and use it regardless of weights; you can disable these level types, or replace there monster generation functions

Modding / Re: A couple questions
« on: April 04, 2013, 20:52 »
I have this :
However the procedures aren't executed when chosen. What am I doing wrong?
This isn't working because you aren't storing the return value of the function call, you are comparing the function itself.

I tried with
Code: [Select]
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"

This is working for me (although there is no end statement).  Are you sure it isn't something else that is wrong?

Modding / Re: Changing the ammo system?
« on: April 03, 2013, 21:35 »
Being prototype:
Code: [Select]
core.register_blueprint "being"
--     fieldname = { required, type, [default] }
name        = { true,  core.TSTRING },
name_plural = { false, core.TSTRING },
id          = { false, core.TSTRING }, -- doesn't need to be in the prototype table; id is passed to the declaration function
sound_id    = { false, core.TIDIN("beings") },
ascii       = { true,  core.TSTRING },
color       = { true,  core.TNUMBER },
sprite      = { true,  core.TNUMBER  },
coscolor    = { false, core.TTABLE },
glow        = { false, core.TTABLE },
overlay     = { false, core.TTABLE },
hp          = { false, core.TNUMBER , 10 },
armor       = { false, core.TNUMBER , 0 },
attackchance= { false, core.TNUMBER , 75 },
todam       = { false, core.TNUMBER , 0 },
tohit       = { false, core.TNUMBER , 0 },
tohitmelee  = { false, core.TNUMBER , 0 },
speed       = { false, core.TNUMBER , 100 },
vision      = { false, core.TNUMBER , 0 },
min_lev     = { true,  core.TNUMBER },
max_lev     = { false, core.TNUMBER , 10000 },
corpse      = { false, core.TANY, 0 },
danger      = { true,  core.TNUMBER },
weight      = { true,  core.TNUMBER },
xp          = { false, core.TNUMBER },
bulk        = { false, core.TNUMBER , 100 },
flags       = { false, core.TFLAGS, {} },
ai_type     = { true,  core.TSTRING },
is_group    = false, -- hard-coded prototype value; can't be specified

res_bullet  = { false, core.TNUMBER, 0 },
res_melee   = { false, core.TNUMBER, 0 },
res_shrapnel= { false, core.TNUMBER, 0 },
res_acid    = { false, core.TNUMBER, 0 },
res_fire    = { false, core.TNUMBER, 0 },
res_plasma  = { false, core.TNUMBER, 0 },

desc            = { true,  core.TSTRING },
kill_desc       = { false, core.TSTRING },
kill_desc_melee = { false, core.TSTRING },

weapon = { false, core.TANY },

OnCreate     = { false, core.TFUNC },
OnAction     = { false, core.TFUNC },
OnAttacked   = { false, core.TFUNC },
OnDie        = { false, core.TFUNC },
OnDieCheck   = { false, core.TFUNC },
OnPickupItem = { false, core.TFUNC },

The four items are rolled separately, it is just by chance that two of them are the same exotic.

This will happen for any weapons that normally auto-equip themselves.  Doesn't depend on AoLT.

Fixed for using from the ground, but not for scavenging yet, as that is a separate issue.  It seems like that might be a little tricky with the way we refactoring the item tracking.

Bug Reports / Re: [] Apostle error
« on: April 03, 2013, 05:05 »
Fixed, thanks for the bug report.

Modding / Re: About traits, doc needed
« on: April 03, 2013, 04:51 »
The ironman bonus is actually
Code: [Select]
math.floor(0.2 * player.hpnom)
although I think AoHu is the only thing that changes hpnom.

I have to agree with yaf about adding and subtracting hp instead of setting it, especially if you want to later reverse the affect.  Remember that there are items that can affect hpmax, and nothing is keeping track of them.  You can calculate the target value you want, and then keep track of the delta so you can reverse it later.

Modding / Re: Changing the ammo system?
« on: April 03, 2013, 04:45 »
I also have another question: From experimentation it seems that a being's scount can become negative without causing errors. What's the lowest value that it can be safely set to? Or are negative values not intended to be used at all?
Scount is a 32-bit signed integer, so it can be as small as -2147483648.  I found one bug relating to the player having a negative scount however.  It may not occur very much in practice because it only happens on the player's turn (when the player's scount will usually be positive).

EDIT2: Could I have an up to date list of the names of the ally prototype fields? When I use the values from the wiki, it doesn't recognise some of them.

Ally?  I'm not sure what you're referring to.

Modding / Re: A couple questions
« on: April 01, 2013, 20:46 »
Isn't it DoomRL.OnCreateEpisode()?

Ah, yes.  It does work after all.  Good catch!

Modding / Re: Changing the ammo system?
« on: March 31, 2013, 11:53 »
The rocket launcher is able to get away with this because it only changes the missile which nothing else really modifies.

If you are worried about modding, I think you could fix this by using a custom item property to keep track of which mode the weapon is in.  In OnFire and OnFired, you can subtract 3 shots and add 3 accuracy, but only if the weapon is in "alt-fire-mode", and in OnAltFire you can add 3 shots and subtract 3 accuracy, but only if the weapon is in "normal-mode".  It still isn't perfect because the effect of a mod sometimes depends on the item's current stats which may be in either mode, so you could also try resetting the stats to normal mode in OnEquipTick.

Modding / Re: Changing the ammo system?
« on: March 30, 2013, 21:11 »
Doesn't seem to work by simply doing that.

It looks like changing it on the fly won't work because the current implementation only checks the flag when the thing is loaded.  It might be hard to do for the player at all because of how early the player is loaded.

Modding / Re: Changing the ammo system?
« on: March 30, 2013, 17:31 »
I need to see how a sprite of a size bigger than one tile is handled. When I try to use them, they are cropped from their upper left corner to one tile.

Give a being (or item) the flag F_LARGE to allow for an oversized sprite.

Modding / Re: Changing the ammo system?
« on: March 30, 2013, 17:18 »
1. I have a missile defined with the MF_RAY flag set, but the game seems to ignore that and still draws a bullet travelling across the screen. It works in console mode however - has the flag become deprecated since graphics were introduced?
I wouldn't say it is deprecated, just not supported in graphics mode yet.

2. Is there a list of sprites somewhere? I don't know the names of any of the missile sprites, so I've had to put in random sprites that I do know for now. Although I suppose there is something to be said for a shotgun that shoots shotguns...

Here's all the sprite constants that are declared; use them.  (Spoilered for length)
Spoiler (click to show/hide)
Alternatively, you could also just copy the values from things you know like beings.imp.sprite.

3. I've been trying to change the missile property of a weapons using the OnFire hook, but I always get an error when I try to assign it - what should the assignment look like?
The value needs to be the number id of the missile.  Number ids are subject to change between versions, so you should translate from the string id e.g.
Code: [Select]
  it.missile = missiles.mgun.nid
  -- or
  it.missile = missiles[string_id].nid

4. This is just out of interest, for now: I notice that calling Player:power_backpack() reshuffles the player's ammo stacks. Is there any way to do this without also turning the backpack on? It would be quite a handy feature.
Honestly, I suspect there are still bugs in power_backpack ;)  But no, I'm not aware of any other code that resorts the inventory like this; it is tied together with the backpack flag.

1. How are the monster's melee attack handled?
Monster melee attacks work exactly the same as the player's default fists attack; they do 1d3 damage plus any bonuses.  The only bonus is typically the monster's todam modifier (which only applies to melee attacks as opposed to todamall).

2. is there any parameter that defines the aggressive behaviour or monsters toward the player? I'd want to invert that behaviour (friendly monsters attacking other monsters)

The built-in AIs don't really have support for this.  You can either write your own AI or try to hack the built-in AI; probably writing a new one is simpler as long as you don't need it to be very complex.

Pages: 1 [2] 3 4 ... 25