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
[SOLVED/I GOT PM]Strange HPL function
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#1
[SOLVED/I GOT PM]Strange HPL function

This is how it is set up in the HPL editor:

[Image: vseu8h.png]


The area has the properties:

Name: AreaPickUpItems
PlayerInteractCallback: PickUpItems
ItemInteraction: "Checked"


I tried making the whole script (That i wanted), but failed so here is the first part, which doesn't work...

Script

void OnStart()
{

SetLocalVarInt("PlacedHandDrill", 0);
SetLocalVarInt("PlacedPoisonGland", 0);
}


void AreaPickUpItems(string &in asEntity)
{
if(GetLocalVarInt("PlacedHandDrill") == 0 && GetLocalVarInt("PlacedPoisonGland") == 0)
{
SetMessage("Messages", "NothingOnPlatform", 0);
}
}

BUT what happens is that when i touch the area, instead of setting the message it collects the two inactive items!!?? Why is this happening?
If i touch the area again it collects the items again. And again. And again... It doesn't make sense to me...

Can anybody explain this? and maybe help me out?

Trying is the first step to success.
(This post was last modified: 08-27-2012, 03:22 PM by FlawlessHappiness.)
08-26-2012, 01:50 PM
Find Reply
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#2
RE: Strange HPL function

Based on what you've explained thus far and the script provided, I have no clue what you're trying to do. Please use explicit detail to describe exactly what you want to have happen in game, and I'll help to the fullest extent of my abilities

I rate it 3 memes.
08-27-2012, 06:39 AM
Find Reply
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#3
RE: Strange HPL function

What i was trying to do is:

In this custom story you are playing as 2 people.
1 of them has went down to get some items, and is now back with 2 items, a hand drill and a poison gland.

If you change to the other person the 2 items will disappear. If you change back they will reappear.

Now: The person with the items (Mark) has to give the items to the other person (Simon).

There is a platform above a big hole where he can put them.

SCRIPT:

if nothing is on the platform = Display: "There is nothing on the platform" (Already here it went wrong)

if use 1 item on the platform, item disappear from inventory, and appear (static) on platform.
if touch platform, (Playing as Simon) Static-item disappear and Simon gets the item.

You should be able to put both items on the platform. and be able to pick up both items at once.

Then when you have picked both items up, you shouldn't be able to put them back again.

I tried the first thing with displaying a message. Instead of displaying it, it picks up the 2 static, inactive items on the platform...

Trying is the first step to success.
08-27-2012, 07:07 AM
Find Reply
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#4
RE: Strange HPL function

One final question, how are you switching between player A and player B? Or is it more like player A does a task, then it switches to player B, he completes a task, then back and forth?

I rate it 3 memes.
08-27-2012, 07:16 AM
Find Reply
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#5
RE: Strange HPL function

You switch youself... i made a script.

Simplyfied script:

FadeOut(2)
AddTimer(Timer)

void Timer
TeleportPlayer
FadeIn
SetGlobalVarInt(PlayingAsMark, 1)
SetGlobalVarInt(PlayingAsSimon, 0)

Trying is the first step to success.
08-27-2012, 07:19 AM
Find Reply
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#6
RE: Strange HPL function

But how is it triggered? Collide, interact, or some other kind of callback?

I rate it 3 memes.
08-27-2012, 07:22 AM
Find Reply
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#7
RE: Strange HPL function

interact

Trying is the first step to success.
08-27-2012, 07:42 AM
Find Reply




Users browsing this thread: 1 Guest(s)