|
|
 |
 |
 |
 |
|
 |
 |
|
 |
 |
|
 |
|
Development::Bug Reports Post detailed bug reports and what you would like to see next in the emu here. |

11-12-2008, 04:04 PM
|
Sarnak
|
|
Join Date: Dec 2007
Posts: 50
|
|
quest::creategroundobject() No charges
Using quest::creategroundobject() it will always spawn items with zero charges no matter what the item is set for in the dbase.
Is there anyway we can get something added to fix this?
Also does anyone have an example using sub EVENT_PICK_UP
I am having trouble getting it work as described.
ect where 4671 is the item that was spawned. Just doesn't work. I have this on the npc that spawns the item.
Code:
sub EVENT_PICK_UP {
if ($picked_up_id == 4671) {
quest::say("You have picked up food");
}
}
Thanks.
Kayen
GM Stormhaven
|

11-12-2008, 04:27 PM
|
Sarnak
|
|
Join Date: Dec 2007
Posts: 50
|
|
Could it just be done like this
old
Code:
void QuestManager::CreateGroundObject(int32 itemid, float x, float y, float z, float heading, int32 decay_time)
{
entity_list.CreateGroundObject(itemid, x, y, z, heading, decay_time);
}
new
Code:
void QuestManager::CreateGroundObject(int32 itemid, float x, float y, float z, float heading, int32 decay_time, uint8 charges)
{
entity_list.CreateGroundObject(itemid, x, y, z, heading, decay_time, charges );
}
|

11-14-2008, 06:36 AM
|
 |
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
I confirmed that there definitely is an issue with this. Everything seems to work properly for ground spawns accept they can't have charges. I am not sure if that is an issue with creating the item, or if something happens when an item is put on the ground or when it is picked up that it removes charges automatically. I am thinking it might be set that way to remove a possible exploit to recharge items by dropping them and picking them back up (at least for tradeable items).
As for the EVENT_PICK_UP, I think that needs to be used in the player.pl only. I don't think NPCs can use that.
|

11-14-2008, 07:43 AM
|
Administrator
|
|
Join Date: Sep 2006
Posts: 1,348
|
|
Yeah it's player pl only, npcs have nothing to do with picking up items! When I was making it I didn't really take into account charges I thought that would get set correctly automatically, we can fix it.
|

11-14-2008, 02:34 PM
|
 |
The PEQ Dude
|
|
Join Date: Apr 2003
Location: -
Posts: 1,988
|
|
That's partially my fault I'm sure. The sub EVENT obviously should be used with player.pl, but I put it under the normal section of the wiki. I'll fix that now as well.
|

11-23-2008, 03:25 AM
|
 |
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
Even using player.pl, I still can't get EVENT_PICK_UP to work. Here is my example player.pl file that I am using in overthere:
Code:
sub EVENT_PICK_UP {
if ($picked_up_id == 4607) {
quest::spawn2(2700766, 0, 0, 1925.4, 3147.5, -50, 192);
}
}
I pick up the item 4607 (a crate) and it is supposed to spawn a Cockatrice at the same location. But, I get nothing at all no matter how I write it.
I also confirmed that ground spawn still always have 0 charges on them if they are set to have a certain amount. They work properly if #summoned, but not if picked up from being a ground spawn.
|

11-23-2008, 03:31 AM
|
 |
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
NOTE: - This is still a problem: I confirmed that ground spawn still always have 0 charges on them if they are set to have a certain amount. They work properly if #summoned, but not if picked up from being a ground spawn.
Nevermind on the player pick up issue though lol. I figured out the problem. Apparently, the sub is called:
Code:
sub EVENT_PLAYER_PICKUP
NOT:
I edited the Wiki to reflect this correction. Just took a little searching through the source to figure out the root cause lol. I am not sure where people got "EVENT_PICK_UP" from though.
Last edited by trevius; 11-23-2008 at 03:49 PM..
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 07:00 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |