| Login to reply | Page: « < 1 of 1 > » |
| 31 Mar 2010 - 21:03 | 2436 |
| rudeboyrave Regular Poster Joined: 12 Nov 2007 Posts: 123 | Applies max at 120.. Why is it that applies (in oedit) max out at 120? |
![]() |
| 01 Apr 2010 - 10:23 | 2438 |
| welcor Regular Poster Joined: 04 Jul 2007 Posts: 262 | Applies are internally represented as a signed byte which means it can have values from -128 to 127. We figured 120 was reasonable as a cutoff.
If you want a larger apply, add it more than once. __________________ You know who I am. |
![]() |
| 01 Apr 2010 - 12:11 | 2439 |
| rudeboyrave Regular Poster Joined: 12 Nov 2007 Posts: 123 | what would be the best way of changing this? Why put this kind of limit on things? |
![]() |
| 01 Apr 2010 - 14:16 | 2440 |
| Fizban Regular Poster ![]() Joined: 05 Jul 2007 Posts: 244 | Quote rudeboyrave:
what would be the best way of changing this? Change it from a byte to a signed integer. Quote rudeboyrave:
Why put this kind of limit on things? To limit memory usage. __________________ ![]() Last edited by Fizban (01 Apr 2010 - 14:17) |
![]() |
| 01 Apr 2010 - 15:20 | 2441 |
| rudeboyrave Regular Poster Joined: 12 Nov 2007 Posts: 123 | would this screw anything up? how much memory could this possibly suck up? |
![]() |
| 03 Apr 2010 - 13:48 | 2446 |
| welcor Regular Poster Joined: 04 Jul 2007 Posts: 262 | How will it affect memory usage?
Put short: not at all. The change:
/** An affect structure. */
struct affected_type
{
sh_int type; /**< The type of spell that caused this */
sh_int duration; /**< For how long its effects will last */
- sbyte modifier; /**< Added/subtracted to/from apropriate ability */
+ sh_int modifier; /**< Added/subtracted to/from apropriate ability */
byte location; /**< Tells which ability to change(APPLY_XXX). */
long /*bitvector_t*/bitvector; /**< Tells which bits to set (AFF_XXX). */
struct affected_type *next; /**< The next affect in the list of affects. */
};
Memory usage after = 6 bytes for short ints, 1 byte for location (+ 1 byte, unused) + 8 bytes for the bitvector + 4/8 bytes for the next pointer. Most systems will not start a new allocation in a space that it can't fit into (ie. the long will start on the next address divisable by 4 (or 8, on 64 bit systems) bytes, not on an odd address). This means at least two bytes are unused in the current system. Changing the type to a short int means one of those bytes are used. __________________ You know who I am. |
![]() |
| Login to reply | Page: « < 1 of 1 > » |