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
Secret Idea (dun dun DUN) + Help Needed
Anxt Offline
Senior Member

Posts: 588
Threads: 12
Joined: Mar 2011
Reputation: 10
#11
RE: Secret Idea (dun dun DUN) + Help Needed

Yeah, that's also true.

04-08-2011, 12:22 AM
Find
Simpanra Offline
Senior Member

Posts: 314
Threads: 28
Joined: Mar 2011
Reputation: 0
#12
RE: Secret Idea (dun dun DUN) + Help Needed

I have looked at palistov's script and I am slightly confused, it looks like it may do what I want but I can't find the place in which I would place my collide callback function for when I collide with the first area. Also, as far as my limited knowledge goes, it looks like the restore sanity function would simply happen straight after the drain sanity function?

Sorry if i am completely mistaken but thank you all for the help so far =)
04-08-2011, 08:18 AM
Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#13
RE: Secret Idea (dun dun DUN) + Help Needed

(04-08-2011, 08:18 AM)Simpanra Wrote: I have looked at palistov's script and I am slightly confused, it looks like it may do what I want but I can't find the place in which I would place my collide callback function for when I collide with the first area. Also, as far as my limited knowledge goes, it looks like the restore sanity function would simply happen straight after the drain sanity function?

Sorry if i am completely mistaken but thank you all for the help so far =)


You add the collide callback under your OnStart()

And no, the drain will end once the player leaves the area (when alState == -1), and the restoration of sanity will also only occur on exiting the script area. I had some strange idea with the local vars which match alState...I'm starting to think that they aren't even needed.

the entire script file containing only your drain event will look like this:

void OnStart()
{
AddEntityCollideCallback("Player", "DrainArea", "SanityDrain", false, 0);
}

void SanityDrain(string &in asParent, string &in asChild, int alState)
{
if(alState == 1) {
SetLocalVarInt("areacheck", 1);
SetLocalVarFloat("defaultsanity", GetPlayerSanity());
}
if(alState == -1) {
Set LocalVarInt("areacheck", -1);
RemoveEntityCollideCallback("Player", "DrainArea"); // this will make the even not occur twice.
}
SetLocalVarInt("damage", 0);
if(GetLocalVarInt("areacheck") == 1) {
for(int s=1;s<100;s++) AddTimer("drain"+s, 1.0, "SanityDrain"); // drain will happen 99 times
}
if(GetLocalVarInt("areacheck") == -1) RestoreDrainedSanity();
}

void SanityDrain(string &in asTimer)
{
GiveSanityDamage(5, false);
AddLocalVarInt("damage", 5); //I suggest not using effects. This may turn out to be very annoying
}

void RestoreDrainedSanity()
{
SetPlayerSanity(GetPlayerSanity() + GetLocalVarFloat("defaultsanity"))
for(int s=1;s<100;s++) RemoveTimer("drain"+s);
}


EDIT:
This current script can be gimmicked by the player; they can simply step in then step backwards. Using two areas would actually provide the intended effect. Anxt was right Big Grin

(This post was last modified: 04-08-2011, 05:45 PM by palistov.)
04-08-2011, 05:39 PM
Find
Simpanra Offline
Senior Member

Posts: 314
Threads: 28
Joined: Mar 2011
Reputation: 0
#14
RE: Secret Idea (dun dun DUN) + Help Needed

Aha! that makes sense! thank you very much for providing me with the script too =) I am in your debt kind sir ^_^ You have my gratitude and my cookies x3

I will get back to you with reports of the success =)

Thank you again,
Edd
04-08-2011, 09:50 PM
Find
Anxt Offline
Senior Member

Posts: 588
Threads: 12
Joined: Mar 2011
Reputation: 10
#15
RE: Secret Idea (dun dun DUN) + Help Needed

D: I don't get any cookies?!!?

:'(

04-08-2011, 10:39 PM
Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#16
RE: Secret Idea (dun dun DUN) + Help Needed

I would be THRILLED to share a cookie with you Anxt!

And I'm glad to help, Simpanra. Good luck with the event!

04-09-2011, 04:33 AM
Find
GraphicsKid Offline
Senior Member

Posts: 258
Threads: 34
Joined: Dec 2010
Reputation: 3
#17
RE: Secret Idea (dun dun DUN) + Help Needed

You're trying to make an underwater effect aren't you. Tongue

Trust me, don't bother with it, I've already tried. You can't use any monsters near water, they don't "feel" right. They move like the water isn't even there.

Man I hope I was right in my first sentence there otherwise the rest of this post has been a waste of time... lol
04-10-2011, 07:07 AM
Find
MrBigzy Offline
Senior Member

Posts: 616
Threads: 18
Joined: Mar 2011
Reputation: 8
#18
RE: Secret Idea (dun dun DUN) + Help Needed

Nice waterlurker avatar, lmao.
04-10-2011, 12:17 PM
Find




Users browsing this thread: 1 Guest(s)