Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with placing item script
Entih Offline
Junior Member

Posts: 47
Threads: 4
Joined: Sep 2010
Reputation: 0
#11
RE: Problem with placing item script

An area which is item interactive will still only highlight with an item which has an active use callback for it, I have noticed, which is why I suggested the callback might have gone awry.

Lets try a bunch of stuff, to see if any works.

First, try giving the use item callback a name, rather than leaving that string blank. Just something like "CheeseCallback" or whatever. It should not matter, but working with other games, I have seen stupid little things cause big issues.

Second, be sure that the area is unobscured by other things or areas. Another probable non-issue, but I have seen the engine get confused on interact callbacks and such when areas are involved.

I made a quick addendum to my own map testing items and using items on areas, and I got it working rather well, so not quite sure where the problem is here...
10-06-2010, 01:10 AM
Find
Neurological Offline
Member

Posts: 71
Threads: 11
Joined: Sep 2010
Reputation: 1
#12
RE: Problem with placing item script

(10-06-2010, 01:10 AM)Entih Wrote: An area which is item interactive will still only highlight with an item which has an active use callback for it, I have noticed, which is why I suggested the callback might have gone awry.

Lets try a bunch of stuff, to see if any works.

First, try giving the use item callback a name, rather than leaving that string blank. Just something like "CheeseCallback" or whatever. It should not matter, but working with other games, I have seen stupid little things cause big issues.

Second, be sure that the area is unobscured by other things or areas. Another probable non-issue, but I have seen the engine get confused on interact callbacks and such when areas are involved.

I made a quick addendum to my own map testing items and using items on areas, and I got it working rather well, so not quite sure where the problem is here...

Still nothing, I'm really clueless. Another thing I forgot, the item I want to use is made out from a combination in the inventory of other two items. But the problem is still that won't let me interact with the area, I tried almost everything.

Neurological - Music Entertainment
http://www.neuro-lab.net
10-06-2010, 02:54 AM
Find
Entih Offline
Junior Member

Posts: 47
Threads: 4
Joined: Sep 2010
Reputation: 0
#13
RE: Problem with placing item script

Alright, now inventory item combining is something I tried, but the combine would always fail miserably (callback would do nothing but would not fail), so not sure I can help that far. Though here it goes.

So the combine callback triggers a give item function where the player is given the item, yes? What does your GiveItem call look like?

Alternatively, if all else fails, try to place the item you want to use directly into the map with the proper settings, and see if it works being picked up. If it does and you cannot figure this out, have an excuse for the player to combine it together in the map rather than in inventory.
10-06-2010, 02:59 AM
Find
Neurological Offline
Member

Posts: 71
Threads: 11
Joined: Sep 2010
Reputation: 1
#14
RE: Problem with placing item script

(10-06-2010, 02:59 AM)Entih Wrote: Alright, now inventory item combining is something I tried, but the combine would always fail miserably (callback would do nothing but would not fail), so not sure I can help that far. Though here it goes.

So the combine callback triggers a give item function where the player is given the item, yes? What does your GiveItem call look like?

Alternatively, if all else fails, try to place the item you want to use directly into the map with the proper settings, and see if it works being picked up. If it does and you cannot figure this out, have an excuse for the player to combine it together in the map rather than in inventory.

Already tried to put the item directly on the map, added also a callback on the item bu nothing. Thats how it looks the combine item script I use in inventory.hps:

void CombineCheeseAndPoison(string &in asItemA, string &in asItemB)
{
PlayGuiSound("15_make_hammer", 1.0f);

RemoveItem(asItemA); RemoveItem(asItemB);

GiveItem("neurocheese_poison", "Puzzle", "NeuroCheesePoisonItem", "neuro_cheesepoison.tga", 0);


}

On GiveItem I tried also using this:

GiveItem("neurocheese_poison_"+i, "Puzzle", "NeuroCheesePoisonItem", "neuro_cheesepoison.tga", 0);

But nothing. I will try another thing, instead of an area I'll try to use another entity to interact with, maybe it works.

Neurological - Music Entertainment
http://www.neuro-lab.net
10-06-2010, 03:11 AM
Find
Entih Offline
Junior Member

Posts: 47
Threads: 4
Joined: Sep 2010
Reputation: 0
#15
RE: Problem with placing item script

Hmm... hold a sec. The item use callback references 'neurocheese_poison_1', but you seem to be giving 'neurocheese_poison'. Is that intentional, or are there multiple of them?

If the names don't match, the use callback wont work.
10-06-2010, 03:14 AM
Find
Neurological Offline
Member

Posts: 71
Threads: 11
Joined: Sep 2010
Reputation: 1
#16
RE: Problem with placing item script

(10-06-2010, 03:14 AM)Entih Wrote: Hmm... hold a sec. The item use callback references 'neurocheese_poison_1', but you seem to be giving 'neurocheese_poison'. Is that intentional, or are there multiple of them?

If the names don't match, the use callback wont work.

I changed it also to make the names match, but still nothing.

Neurological - Music Entertainment
http://www.neuro-lab.net
10-06-2010, 03:26 AM
Find
Entih Offline
Junior Member

Posts: 47
Threads: 4
Joined: Sep 2010
Reputation: 0
#17
RE: Problem with placing item script

That honestly exhausted all my ideas.

If you would like, I could try and take a look at it for you, but that would require packing it up and sending it to me somehow. Without seeing it for myself, though, I can't think of any other solutions.
10-06-2010, 03:32 AM
Find
Neurological Offline
Member

Posts: 71
Threads: 11
Joined: Sep 2010
Reputation: 1
#18
RE: Problem with placing item script

(10-06-2010, 03:32 AM)Entih Wrote: That honestly exhausted all my ideas.

If you would like, I could try and take a look at it for you, but that would require packing it up and sending it to me somehow. Without seeing it for myself, though, I can't think of any other solutions.

If for you is not a waste of time, I don't want to take your time for maybe such a little thing.

Neurological - Music Entertainment
http://www.neuro-lab.net
10-06-2010, 11:45 AM
Find
Entih Offline
Junior Member

Posts: 47
Threads: 4
Joined: Sep 2010
Reputation: 0
#19
RE: Problem with placing item script

I don't mind taking a look if you don't mind me looking. You can just PM me with a download or something like that if you want me to check it out, and I can prod around and see if I can find the issue.

With how much script I have written for my own map, I feel problem solving has become a bit of a hobby of mine.
10-06-2010, 10:23 PM
Find




Users browsing this thread: 1 Guest(s)