Chaosforge Forum

  • March 28, 2024, 08:46
  • 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 - Autoquark

Pages: [1] 2
1
Modding / Re: Changing the ammo system?
« on: May 19, 2013, 09:40 »
According to the wiki, one sniper weapon pack causes a weapon to have no range penalties to accuracy, and a second one causes it not to suffer any penalty against hitting a target you can't see. Are there some new item flags that set this behaviour? The wiki states that IF_AUTOHIT is used by sniper packs, but I assume that's for older versions where a sniper pack just caused a weapon to always hit.

2
Modding / Re: Changing the ammo system?
« on: April 14, 2013, 08:26 »
Thanks. According to the wiki, "picture" is just the object property of "ascii", and if I print it using ui.msg, I get a number that depends on the ascii property, so this seems correct. Is there another object property that holds the assembled sprite? I was thinking I might be able to register items with all the sprite and glow combinations I might need (I'm only planning on using pure red, green and blue glows) and then copy the assembled sprite property from an object of that item to the item whose sprite I want to change.

EDIT: So is there no way to change an item's description after it has been created? You didn't mention it, but the wiki says that the object property "desc" is the name of the object rather than the description, and doesn't list an object property for the description.

3
Modding / Re: What are the items numerical IDs?
« on: April 13, 2013, 06:38 »
Apologies if you already know this, but you realise you can use

Code: [Select]
items["pistol"].nid
to get the numerical id from the string id?

4
Modding / Re: Changing the ammo system?
« on: April 13, 2013, 06:36 »
sprite - on ground
psprite - on soldier, equipped
color - in inventory and ascii
coscolor - color for sprites
glow - glow

I meant how do I refer to them in hooks, rather than what they mean - the wiki claims that the property name of the sprite is the same as the prototype key, but I've been getting errors when I try to reference it, and it doesn't mention the property name for glow at all.

5
Modding / Re: Changing the ammo system?
« on: April 13, 2013, 05:42 »
I've been trying to alter item.desc in a hook, but if I do

Code: [Select]
ui.msg(item.desc)
it prints the item name with the damage and ammo appended instead of the description.

6
Modding / Re: Changing the ammo system?
« on: April 13, 2013, 04:21 »
It's the IF_SHOTGUN flag indeed, the rocket launcher has it for that matter.

According to the wiki, that flag makes it expect a shotgun missile, and if I try setting IF_SHOTGUN on one of the explosive weapons in my mod, it crashes when it tries to register it.

EDIT: What are the property names of glow and sprite?

7
Modding / Re: Changing the ammo system?
« on: April 13, 2013, 03:21 »
If I inadvertently end up providing info that's both useful and not on the wiki please put it up.  I would myself but the time... it is not there.

I'll try to do that.

What is it that determines if shottyman applies to a weapon? I assume it's the IF_SHOTGUN flag for shotguns, but is there a new flag for rocket launchers?

8
Modding / Re: Changing the ammo system?
« on: April 11, 2013, 06:25 »
Thanks, yaflhdztioxo. Only three of those being hooks are documented on the wiki.

Does being:wear(item) work on weapons, and does it work for items that aren't in the inventory? I'm trying to implement a grenade weapon that is stored in stacks in the inventory but is equipped one at a time. I've got this:

Code: [Select]
register_item "hl_grenade" { --delayed explosion requires more hooks
name = "Hand Grenade",
desc = "Good thing you can throw accurately.",
ascii = "*" ,
color = BROWN,
sprite = SPRITE_ROCKET,
glow = {1,0,0,0.5},
level = 6,
weight = 200,
flags = {IF_NONMODABLE, IF_NOAMMO},
firstmsg = "These could come in handy.",
color_id = "generic",
--type specific
        type     = ITEMTYPE_RANGED,
damage        = "5d5",
    damagetype    = DAMAGE_FIRE,
    group         = "weapon-rocket",
    fire          = 10,
    acc           = 0,
    radius        = 4,
    shots         = 0, --setting to 1 leads to x1 being appended to name, which is seriously confusing here
    ammo_id       = "shell", --not actually used
    ammomax       = 0,
    reload        = 10,
    shotcost      = 0,
    altfire       = ALT_NONE,
    --altfirename   = "double shot",
    altreload     = RELOAD_FULL,
    --altreloadname = "dualreload",
    --sound_id       = "shotgun",
    missile       = "hl_grenade_missile",
psprite   = SPRITE_PLAYER, --the sprite used to represent the player when equipped

OnCreate = function(self)
self:add_property("quantity", 2)
self:add_property("base_name", self.name) --used by test.SetNameFromQuantity
test.SetNameFromQuantity(self)
end,

OnEquipCheck = function(self, equipper)
if self:get_property("quantity") == 1 then return true end

self:set_property("quantity", self:get_property("quantity") - 1)
test.SetNameFromQuantity(self)
local spawned = item.new(items[self.id].nid) --spawn a new grenade item with 1 quantity
spawned:set_property("quantity", 1) --set quantity
test.SetNameFromQuantity(spawned)
if player:wear(spawned) == true then ui.msg("success") else ui.msg("fail") end --equip the new item
return false --don't equip this item
end,
}

When I attempt to equip a stack of more than 1 grenade, I get the message "success", the size of the stack decreases by 1 but the grenade isn't equipped. Equipping a single grenade works.

Also, it turns out that being.inv:add() does work on monsters. Thanks SPTX for suggesting that - I thought I'd tried it before but evidently not.

EDIT: What sound IDs exist that are appropriate for explosions?

9
Modding / Re: Changing the ammo system?
« on: April 08, 2013, 10:17 »
I'm not sure I understand how the player hooks work. How do I set them, and do I only have the standard being OnCreate, OnAction and OnDie hooks, or is there something like a generic OnFire hook for the player?

10
Modding / Re: Changing the ammo system?
« on: April 06, 2013, 11:23 »
Thanks. Is there any way of accessing the target being (or at least its location) from inside the OnFire hook?

11
Modding / Re: Changing the ammo system?
« on: April 04, 2013, 10:48 »
I think it may be related to scripted levels as they do not use the generator to place enemies. Try to make a replacement of each being you need replaced using the OnEnter hook.

If you mean special levels like Hell's Arena, it's an episode mod, so they're not generated. If you mean stuff like vaults full of lost souls then you're probably right that the monsters are fixed. I was hoping I could specifically change the monsters in each special room, but just replacing each monster type might be the best I can do.

EDIT: Also, how do you add items to a monster's inventory. I've been trying
Code: [Select]
local i = 0
self:set_inv_item(i,being.new("hl_handgun")) i = i+1
self:set_inv_item(i,being.new("ammo")) i = i+1

But it errors. I don't actually need it to use the items, I just want them to be dropped when it dies, so I could spawn them on death instead.

12
Modding / Re: Changing the ammo system?
« on: April 04, 2013, 08:02 »
Thanks. Could you tell me what the names of the built in ai types are?

EDIT: 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?

13
Modding / Re: Changing the ammo system?
« on: April 03, 2013, 13:20 »
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).

So far I'm only changing monster's scount values, so I guess I'll try allowing them to go negative. I'll post if anything odd happens.

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

Oops. I meant to say "Being". I think I typed ally because one of the error fields was "group" and I'd tried "ally" and "allegiance" as random guesses at what the new name was.

14
Releases / Re: MOCKRL: CYBERMDEON MADDNES!1!!!11
« on: April 01, 2013, 09:51 »
My best attempt so far:

Spoiler (click to show/hide)

15
Modding / Re: Changing the ammo system?
« on: March 31, 2013, 13:46 »
We have custom item properties?  I thought that was beings only...

You definitely do, I've been using them.

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.

The problem with this is that OnEquipTick seems to be called before OnAltFire - at any rate, if I press alt fire then cancel the targeting, the alt fire stats remain until another tick has passed, so if I apply a mod pack immediately, it acts on the alt fire stats. The alt fire stats also remain if I immediately unequip the item, but this can be fixed with the OnRemove hook. So it almost works, but without any hook being called immediately after cancelling targeting, I don't see how I can make it perfect. Is there any chance we could get an OnCancelFire hook in the next version?

EDIT: I've decided to fix this by putting an extra check in all of my mod packs which will prevent a mod being applied in the one turn when the stats are wrong. It's not ideal, but as I'm not planning on using any of the original mod packs, it should work. 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?

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.

Pages: [1] 2