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 suck at scripting, help!
TarkoRehin Offline
Junior Member

Posts: 11
Threads: 3
Joined: Jan 2011
Reputation: 0
#1
[SOLVED] I suck at scripting, help!

First I want to apologize for making a thread like this (I'm guessing you guys get them alot..)

I've been reading around and trying to script for a few days now, and not a single script I've done works.. It's getting on my nerves really.

Here's one of my scripts.. (You'll probably laugh at my stupidity when you see this, but please bear with me.)

void TakeTinder("tinderbox_1", "OnPickup")
{
    SetEntityActive("servant_grunt_1", true);
}

What I want this to do is when I pickup the tinderbox a grunt should spawn (or activate).

I'm assuming when guides say things like "string &in asEntity" they want me to replace that text entirely with the entities name? correct me if I'm wrong, I've never found a clear explanation of it.

Some more information to make things clear:
I've named the tinderbox "tinderbox_1". (duh)
I've named the grunt "servant_grunt_1". (duh)
I've written "TakeTinder" without quotations in the tinderbox's CallbackFunc.
The grunt is currently not "active".
The grunt is a hallucination, but that's not the problem as it never actually appears anyways.

That's it for now, I will add information if required.

I'd very much appreciate if you checked out my Youtube channel: https://www.youtube.com/user/RehinRealm
Thanks!
(This post was last modified: 01-22-2011, 04:43 PM by TarkoRehin.)
01-21-2011, 09:45 PM
Find
ThePaSch Offline
Member

Posts: 108
Threads: 11
Joined: Sep 2010
Reputation: 0
#2
RE: I suck at scripting, help!

Quote:I'm assuming when guides say things like "string &in asEntity" they want me to replace that text entirely with the entities name? correct me if I'm wrong, I've never found a clear explanation of it.

Alright.
You're wrong! Big Grin
Don't replace the parameters with their names, leave them as they are. At least in the declaration of the function, you'll of course have to replace them inside the function brackets.

Basically, whenever you call a function, replace the parameters.
Whenever you define a new function, leave them as they are.
(This post was last modified: 01-21-2011, 09:55 PM by ThePaSch.)
01-21-2011, 09:54 PM
Find
TarkoRehin Offline
Junior Member

Posts: 11
Threads: 3
Joined: Jan 2011
Reputation: 0
#3
RE: I suck at scripting, help!

Okay then I got
void TakeTinder(string &in asEntity, string &in asType)
{
    SetEntityActive("servant_grunt_1", true);
}

I tried this once before changing the parameters and it didn't work, tried it again now same result.
Just gonna take another guess that I'm using the wrong parameters?
If so what parameters should I use, and where can I read about when to use what parameters? Thank you ^^

I'd very much appreciate if you checked out my Youtube channel: https://www.youtube.com/user/RehinRealm
Thanks!
01-21-2011, 10:04 PM
Find
Sharkhead Offline
Junior Member

Posts: 10
Threads: 1
Joined: Jan 2011
Reputation: 0
#4
RE: I suck at scripting, help!

Hey, i'm new in this forum (I register today) and i really suck too with scripts...

I mean, when i just want something to happen in my custom story, i search here and copy-paste in my .hps file... and then, just a few scripts works, i don't understand these "codes" of scripts...

I really liked this topic, maybe i can learn something.
01-21-2011, 10:41 PM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#5
RE: I suck at scripting, help!

You sound like a spam to me. No offense.

01-21-2011, 10:57 PM
Website Find
TarkoRehin Offline
Junior Member

Posts: 11
Threads: 3
Joined: Jan 2011
Reputation: 0
#6
RE: I suck at scripting, help!

Me or Sharkhead? Regardless, none offense taken Tongue

I'd very much appreciate if you checked out my Youtube channel: https://www.youtube.com/user/RehinRealm
Thanks!
(This post was last modified: 01-21-2011, 11:07 PM by TarkoRehin.)
01-21-2011, 11:07 PM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#7
RE: I suck at scripting, help!

Sharkhead.
I have a blog that receives too many spams to drive me nuts, which starts with "I'm new here" and ends "I liked it here".

01-21-2011, 11:47 PM
Website Find
TarkoRehin Offline
Junior Member

Posts: 11
Threads: 3
Joined: Jan 2011
Reputation: 0
#8
RE: I suck at scripting, help!

Going to bed, hoping to figure this out tomorrow xD

I'd very much appreciate if you checked out my Youtube channel: https://www.youtube.com/user/RehinRealm
Thanks!
01-22-2011, 12:37 AM
Find
Tottel Offline
Senior Member

Posts: 307
Threads: 9
Joined: Nov 2010
Reputation: 0
#9
RE: I suck at scripting, help!

Do you have anything else in your script file except for those 3 lines? :p
01-22-2011, 11:59 AM
Find
TarkoRehin Offline
Junior Member

Posts: 11
Threads: 3
Joined: Jan 2011
Reputation: 0
#10
RE: I suck at scripting, help!

My script file looks like this:

void TakeTinder(string &in asEntity, string &in asType)
{
    SetEntityActive("servant_grunt_1", true);
}

void OnStart()
{

}

void OnEnter()
{

}

void OnLeave()
{

}

I'd very much appreciate if you checked out my Youtube channel: https://www.youtube.com/user/RehinRealm
Thanks!
01-22-2011, 02:49 PM
Find




Users browsing this thread: 2 Guest(s)