The chaser
Posting Freak
Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation:
113
|
RE: How to achieve this scenario?
(02-01-2013, 04:09 AM)serbusfish Wrote: Thanks for being patient with me, but something is still wrong because I pasted that exact code and the game throws up an error message saying 'ERR - expected '('.
It must have something to do with the line
"void BreakPotPlant(string &in asParent, string &in asChild, int alState)"
because the map loads when this is deleted. Am I supposed to replace the text in this line?
If it helps here is the entire content of my .hps file so far:
//===========================================
// This runs when the map first starts
void OnStart()
{
if(ScriptDebugOn())
{
GiveItemFromFile("tinderbox", "tinderbox.ent);
AddEntityCollideCallback("Player", "ScriptArea_2", "BreakPotPlant", true, 1);
}
}
void BreakPotPlant(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("pot_plant_small02_1", 0);
}
//===========================================
// This runs when the player enters the map
void OnEnter()
{
//----AUDIO----//
PlayMusic("10_amb", true, 5, 1, 0, true);
}
//===========================================
// This runs when the player leaves the map
void OnLeave()
{
}
There, fixed it.
THE OTHERWORLD (WIP)
Aculy iz dolan.
|
|
02-01-2013, 10:28 AM |
|
serbusfish
Member
Posts: 211
Threads: 75
Joined: Aug 2012
Reputation:
0
|
RE: How to achieve this scenario?
With your version it gives me the error 'Unexpected end of file', any ideas? Even to this n00b your code looks right.
EDIT: Fixed it! The tinderbox line was missing a ".
Im getting closer, now I need to try and make the camera look
(This post was last modified: 02-01-2013, 05:17 PM by serbusfish.)
|
|
02-01-2013, 05:04 PM |
|
Kreekakon
Pick a god and pray!
Posts: 3,063
Threads: 70
Joined: Mar 2012
Reputation:
124
|
RE: How to achieve this scenario?
(02-01-2013, 05:04 PM)serbusfish Wrote: With your version it gives me the error 'Unexpected end of file', any ideas? Even to this n00b your code looks right.
That probably means that one of the brackets in the code is out of place. Go check to see if all of them all have proper corresponding ones.
Notepad++ thankfully makes this extremely easy.
(This post was last modified: 02-01-2013, 05:18 PM by Kreekakon.)
|
|
02-01-2013, 05:17 PM |
|
serbusfish
Member
Posts: 211
Threads: 75
Joined: Aug 2012
Reputation:
0
|
RE: How to achieve this scenario?
Well so far so good, I managed to make it so the pot breaks, the player looks, a monster growls, and a few secs later a door shuts. (I changed the monster walk to a growl as you couldnt hear the footsteps over the background music).
Now, sorry to be a pain again but rather than make another thread I was wondering if one of you kind gents could help me make a lever open a locked door? Does it have anything to do with this command?:
void SetEntityConnectionStateChangeCallback(string& asName, string& asCallback);
I am getting more used to the scripting enviroment, but im not sure in this particular instance how you link the lever to the door I want opened?
|
|
02-03-2013, 03:58 AM |
|
The chaser
Posting Freak
Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation:
113
|
RE: How to achieve this scenario?
Oh, just:
void OnStart()
{
SetEntityConnectionStateChangeCallback("Lever", "Call");
}
void Call (string &in asEntity, int alState)
{
SetSwingDoorLocked("Door", false, true);
}
THE OTHERWORLD (WIP)
Aculy iz dolan.
|
|
02-03-2013, 11:54 AM |
|
serbusfish
Member
Posts: 211
Threads: 75
Joined: Aug 2012
Reputation:
0
|
RE: How to achieve this scenario?
(02-03-2013, 11:54 AM)The chaser Wrote: Oh, just:
void OnStart()
{
SetEntityConnectionStateChangeCallback("Lever", "Call");
}
void Call (string &in asEntity, int alState)
{
SetSwingDoorLocked("Door", false, true);
}
Thank you i'll give it a try
|
|
02-05-2013, 03:29 AM |
|
serbusfish
Member
Posts: 211
Threads: 75
Joined: Aug 2012
Reputation:
0
|
RE: How to achieve this scenario?
Update, I must be doing something wrong because the game wont load, here is what ive got:
void OnStart()
{
if(ScriptDebugOn())
SetEntityConnectionStateChangeCallback("lever_small01_1", "Call");
}
void Call(string &in asEntity, int alState)
{
SetSwingDoorLocked("castle_arched01_6", false, true);
}
What did I do?
|
|
02-08-2013, 02:33 AM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: How to achieve this scenario?
What exactly is it you want with this line: "if(ScriptDebugOn())"?
It isn't used in any way, and it is probably the one that crashed the game.
Trying is the first step to success.
|
|
02-08-2013, 06:45 AM |
|
serbusfish
Member
Posts: 211
Threads: 75
Joined: Aug 2012
Reputation:
0
|
RE: How to achieve this scenario?
(02-08-2013, 06:45 AM)BeeKayK Wrote: What exactly is it you want with this line: "if(ScriptDebugOn())"?
It isn't used in any way, and it is probably the one that crashed the game.
I dont know it was included in the tutorial script. I'll remove it and see what happens, but apart from that does my script look ok?
|
|
02-08-2013, 01:48 PM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: How to achieve this scenario?
Yea it doesn't look like there should be any problems if you delete the line i specified.
Trying is the first step to success.
|
|
02-08-2013, 03:37 PM |
|
|