Chaosforge Forum

  • April 27, 2024, 01:58
  • 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 - SPTX

Pages: 1 ... 3 4 [5] 6
61
Modding / Re: Changing the ammo system?
« on: March 30, 2013, 17:29 »
Speaking of sprite. Can I have the source code of the cyberdemon/spidermastermind?
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.

62
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).
I figured as much, the thing is I have no idea how the default fist attack works and can't find doc on it.

Quote
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.
Well, I'd just want them to ignore the player and attack other beings instead. This is for player-spawned lostsouls and resurrected monsters precisely. So this applies only to the last created being, three at most concerning the lostsouls which should not bee an issue if turning the monsters friendly could be done by a function call.

63
Thank you, it works wonders.

Now I have yet an other questions.

1. How are the monster's melee attack handled? I am thinking about monsters that have both ranged and melee attacks, such as cacodemons. They obviously don't switch weapons, and they seem to be rolling dice too.
What I want to do is basically override the player melee attack that is used under the same circumstances (ranged weapon equipped, bumping into an enemy) But I don't find anything helping me in either "being" and "thing" nor "player" pages of the wiki.

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)

64
How do you ADD a flag?
I use
Code: [Select]
OnEquip = function (self,player)
player.flags = {BF_ENVIROSAFE} end,
(which didn't grant me fluid invulnerability btw) but I believe it replaces the flags instead of adding to it. I also tried some other silly equations that obviously give errors.

65
Post your current procedure as a non-jpeg so I can copy it in and see what happens.

And fer chrissakes, use indenting :/.  I cannot stress this enough for new coders.  It will make your life and by extension my life easier.
Nevermind, my mistake, that works.
Thanks a lot.

I'll try using indenting, I already do it here and there, but I have a hard time getting the conventions right.

So you don't need your hooks to make the player resistant - just set a resistance value on the item.
You are right. I wonder where I fucked up.
Anyway, there are monsters in the game that are invulnerable to fluids. How is this achieved? They don't seem to use resistances since there is no pain sound.

66
Welp, I just tried and it yields the same error.

67
You are missing a comma.  The functions are just like the other attributes--they must be comma delimited.
Where is that comma supposed to go?
I tried on both lines of each and none want to work.

68
Proper syntax is:
Code: [Select]

OnEquip = function (self,being)
your_actions
end,
Thanks I am trying that right away.

EDIT : alright this works however I can't make more than one function to work on an item, when I try to put a second one, like for :
Code: [Select]
OnEquip = function (self,player)
player.res_acid = player.res_acid+50 end
OnRemove = function (self,player)
player.res_acid = player.res_acid-50 end
The crashlog tells me that the last line of the second one (where I remove the res bonus) is expected to close my whole item declaration even though neither notepad++ nor I see a syntax error.
here I just changed the enabled functions but the issue is still the same (second function in order fucking up)
Embedding the second function in the first allows the game to launch but will ultimately cause an error on use.
--------------------------

Quote
Damage_Add is still a valid item attribute.  I've manipulated it in 0997 with success before. Other options for boosting damage on equip would be adjusting the player's todamall trait.
Don't know why, it just did not accept damage_add, unless it takes upper casing into account, I don't think I made a mistake. Also I don't want to boost the overall player damage, just the weapons, so the "XdY+Z" notation is perfect.

Quote
Now for critiques. Why are you adding these adjustments to the OnEquip hook when you can just modify the item directly?
For damage I don't, that's is unrelated. Sorry if I was not clear about it. I do this for the later (resistances), which aren't handled by weapons.

Quote
You are also increasing/decreasing attributes by fixed amounts. For resistances I *think* that's the right way to do it but for movetime it NEEDS to be a multiplier (player.movetime = player.movetime * 1.05).  If you don't do this the math gets wonky fast and can easily be exploited for good or for ill.
That clears some things up, thanks.

Player sounds may or may not be modifiable. The sound engine is still one of the weak spots in DoomRL modding. IF they can be changed it would be with this code:
Code: [Select]
beings["soldier"].sound_melee = core.resolve_sound_id("your_sound")You can reuse another being's sound by replacing "your_sound" with their sound name.  For instance, "soldier.melee" would be the player's default punching noise.  If you have a custom sound in your /sound directory then you would replace "your_sound" with its extension-less name.[/quote]
I'll try that, however I noticed the sound_ID were different from the actual sound file names eg : the ID for the shotgun fire is "shotgun" but the filename is "dsshotgn". How does the game differentiate ID from filename?
Quote
As for quick_weapon that cannot be abused.  Only cursed weapons block the equip/unequip logic.
My aim isn't to prevent the weapon from just being unequipped but also to prevent the player from changing weapon at all, ie : note being able to switch to the "prepared" slot.

69
That is sad. And what about the sprites?

EDIT :
I have an other issue :
Code: [Select]
function OnEquip()
player.res_fire = player.res_fire+25
player.movetime = player.movetime+5
function OnRemove()
player.res_fire = player.res_fire-25 end end
It says "expected ( near OnEquip". It seems to be a syntax error, but I just don't get it. The code is inserted into an weapon type item. My objective was to change the player stats according to the equipped weapon and revert if unequipped.

Can we have the sources for player emitted sounds too? I also need a way to override default player melee attack (when you bump into a monster without an equipped melee weapon or with an equipped ranged weapon).
I also wanted to prevent weapon switching, I think that can be achieved looping the player:quick_weapon function with the weapon I want to keep in hand as the ID.

EDIT 2 : On a side note, the field "damage_add" doesn't seem to be valid anymore on items, so I added +1 to my dice roll (1d3+1). It appears ingame and works.

70
Here. I had trouble finding it too.
Ah! Thanks. That will boost my productivity.

71
Ah, sorry.  I'm running in the dev environment, so I guess that's not allowed normally.  The example provided by classic.module should show you how to get a basic episode.  All that really remains is to add the special levels, which I believe are still available even in the normal environment.

classic.module shows how to do "script" levels that replace basic levels.  To add special stairs to a level (this is partly a function of the generator), do e.g.:
Code: [Select]
player.episode[2].special = "hells_arena"

The ids of the special levels are more or less what you would expect, but you can print out the "levels" table to check.
That will do until I can get the content done, however I really intended to use the base levels for my mod, as I just aimed for a content mod.
What are the names of the boss levels? And how do I set the levels to use the generators for the levels after bosses (like hell)

Now, on an unrelated note, I have several questions.

1. How do I use sprites? What folder, format, res, colour of alpha channel...?
2. I intend to make a(some) new klasse(s), with their own traits, but I can't get my hands on any source of either klass or trait to see how they are made.
3. Is there a list somewhere of items ID? I quite struggled to find that 10mm ammo's name was "ammo" for example. I am planning to make some assemblies and have a hard time imagining all the name combinations I'd have to try to find the mods IDs

72
You can call DoomRL.OnCreateEpisode in the OnCreateEpisode hook to create the default episode (and use DoomRL.OnGenerate to use the default generator).
I tried this
Code: [Select]
function SPTXContentPack.OnCreateEpisode()
DoomRL.CreateEpisode()
end
But get this error : main/lua6: attempt to call field 'CreateEpisode' (a nil value)
Line 6 is "DoomRL.CreateEpisode()". Do I have to send any argument? I tried DoomRL.CreateEpisode(1) for shit and giggles, but it lend the same error.

73
Modding / Re: Changing the ammo system?
« on: March 29, 2013, 12:09 »
Since you have IF_SHOTGUN, the game is looking in the shotgun list instead of the normal list.  If you want it to be a shotgun, change the missile to a proper shotgun type (like "snormal"), otherwise remove the IF_SHOTGUN flag.
Well that fixed it. Thanks. A lot.

74
Modding / Re: Changing the ammo system?
« on: March 29, 2013, 11:45 »
It is failing because "gun" is not defined as a missile.  It has been renamed to "mgun".  (I think all the missiles gut "m" added at the beginning and all the shotgun-type missiles got "s" added to the beginning.)

Also, the id field should no longer be included in the table; the initial argument to register_item (e.g. "new_pulsecannon") will be used as the id.
I have the same error as this dude (and did the same mistake) however even after changing "gun" to "mgun" I still have the error.
Here is the incriminated code.
Code: [Select]
register_item "SPTXsniperrifle"{
name = "Long range rifle",
    type = ITEMTYPE_RANGED,
sprite = SPRITE_CHAINGUN,
level = 2,
weight = 160,
psprite = SPRITE_PLAYER_SHOTGUN,
    ammo_id = "ammo",
    group = "weapon-shotgun",
    damage = "10d2",
damagetype = DAMAGE_BULLET,
    missile = "mgun",
    fire = 15,
    reload = 10,
    acc = 2,
    ammomax = 5,
flags = {IF_PUMPACTION,IF_SHOTGUN},
    desc = "A rifle designed to shoot targets at very long distances.",
    altfire = ALT_AIMED,
}

75
"run" is a special function required "single" type levels that does what the OnCreate hook normally does for levels that are declared with register_level.  For other level hooks, "single" levels can just use the corresponding module hooks since there is only one level anyway.

Typically, the "run" function will set up the map (maybe with a generator.place_tile call) and place the player (level:player(x,y)).
That's what I figured out. So I used episode instead, but it seems I have to script the whole episode myself. Isn't there a way to just call for the default one?

Pages: 1 ... 3 4 [5] 6