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
Script Help Weeping Angel enemies
7heDubz Offline
Posting Freak

Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation: 41
#11
RE: Weeping Angel enemies

(06-19-2013, 06:59 PM)Smoke Wrote: You'll have the chase music whenever you don't look at him though. Keep that in mind.

Changeable,

just use IFC

06-20-2013, 04:00 AM
Find
OriginalUsername Offline
Posting Freak

Posts: 896
Threads: 42
Joined: Feb 2013
Reputation: 34
#12
RE: Weeping Angel enemies

(06-20-2013, 04:00 AM)WIWWM Wrote:
(06-19-2013, 06:59 PM)Smoke Wrote: You'll have the chase music whenever you don't look at him though. Keep that in mind.

Changeable,

just use IFC

Yeah, but wont you delete all the chase music for all the monsters?
06-20-2013, 06:54 AM
Find
7heDubz Offline
Posting Freak

Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation: 41
#13
RE: Weeping Angel enemies

(06-20-2013, 06:54 AM)Smoke Wrote:
(06-20-2013, 04:00 AM)WIWWM Wrote:
(06-19-2013, 06:59 PM)Smoke Wrote: You'll have the chase music whenever you don't look at him though. Keep that in mind.

Changeable,

just use IFC

Yeah, but wont you delete all the chase music for all the monsters?

wont I? no what do you mean?
in the config files there should be an option for what file to use for chase music. just leave it blank. if its an IFC being used it wouldn't be a problem.

(This post was last modified: 06-20-2013, 07:19 AM by 7heDubz.)
06-20-2013, 07:18 AM
Find
OriginalUsername Offline
Posting Freak

Posts: 896
Threads: 42
Joined: Feb 2013
Reputation: 34
#14
RE: Weeping Angel enemies

I get that, but what happens when you place another enemy, like a brute? You wont hear any chase music when he chases you
06-20-2013, 07:36 AM
Find
7heDubz Offline
Posting Freak

Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation: 41
#15
RE: Weeping Angel enemies

depends, unless your having the monster look for the player there's no problem. if you have the monster see the player's position (automatically making him chase the player), if you do that you could script in the music/terror meter.

06-20-2013, 07:40 AM
Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#16
RE: Weeping Angel enemies

void ShowEnemyPlayerPosition(string& "angel_statue_1);\\Makes angel follows player

This line is wrong in a few ways Smile
Firstly when you are 'calling' a function (i.e. trying to run the function from within your script), you need to not include the 'void' keyword
Second, strings are always surrounded by "" , you've got one at the start, but you haven't got one at the end
Third, when you are providing a string as a 'parameter' for a function (i.e. the stuff you put in the brackets), you need to not include 'string&', that keyword is included in the actual code for the function to define the type of 'parameter' that you need to include, but when actually using the function as you are here, all you need to do is provide the parameter itself
Fourth, the slash character's you have included are the wrong way round! You've used \\, but the comments are defined by //


Here's what the fixed line should look like

ShowEnemyPlayerPosition("angel_statue_1"); //Makes angel follows player


However there is a slightly more pressing issue - ShowEnemyPlayerPosition only works on entities that are set up to be enemies - so it can only work on a Grunt or a Brute, unless you set up a custom monster yourself. The angel statue that comes with the game is not set up as an enemy, so it can't chase the player, although you could just test this method using a grunt or brute, with the intention of changing that later

Quote:From what you guys told me I have compiled this: (I havent tried it yet because if i encounter any problems i dont want to spend hours on the internet trying to find out my script is wrong)

The absolute best and quickest way to learn how to write correct code is to write it, run it, find out that it's broken, then look for the solution. The error messages you will get are (usually) quite helpful in determining the problem. If you are waiting for people in the community to respond to every question it will slow you down a great deal. I guarantee you that all the problems you come across writing a line like the one above, other people have experienced as well, have created a thread about it and been given a solution, so the answers will be there if it goes wrong, and don't forget - you are never going to break the game with you're scripts, don't be afraid to experiment, it's the best way to learn

(This post was last modified: 06-20-2013, 01:04 PM by Adrianis.)
06-20-2013, 12:57 PM
Find
lizardrock17 Offline
Junior Member

Posts: 20
Threads: 3
Joined: Jun 2013
Reputation: 0
#17
RE: Weeping Angel enemies

(06-20-2013, 12:57 PM)Adrianis Wrote:
void ShowEnemyPlayerPosition(string& "angel_statue_1);\\Makes angel follows player

This line is wrong in a few ways Smile
Firstly when you are 'calling' a function (i.e. trying to run the function from within your script), you need to not include the 'void' keyword
Second, strings are always surrounded by "" , you've got one at the start, but you haven't got one at the end
Third, when you are providing a string as a 'parameter' for a function (i.e. the stuff you put in the brackets), you need to not include 'string&', that keyword is included in the actual code for the function to define the type of 'parameter' that you need to include, but when actually using the function as you are here, all you need to do is provide the parameter itself
Fourth, the slash character's you have included are the wrong way round! You've used \\, but the comments are defined by //


Here's what the fixed line should look like

ShowEnemyPlayerPosition("angel_statue_1"); //Makes angel follows player


However there is a slightly more pressing issue - ShowEnemyPlayerPosition only works on entities that are set up to be enemies - so it can only work on a Grunt or a Brute, unless you set up a custom monster yourself. The angel statue that comes with the game is not set up as an enemy, so it can't chase the player, although you could just test this method using a grunt or brute, with the intention of changing that later

Quote:From what you guys told me I have compiled this: (I havent tried it yet because if i encounter any problems i dont want to spend hours on the internet trying to find out my script is wrong)

The absolute best and quickest way to learn how to write correct code is to write it, run it, find out that it's broken, then look for the solution. The error messages you will get are (usually) quite helpful in determining the problem. If you are waiting for people in the community to respond to every question it will slow you down a great deal. I guarantee you that all the problems you come across writing a line like the one above, other people have experienced as well, have created a thread about it and been given a solution, so the answers will be there if it goes wrong, and don't forget - you are never going to break the game with you're scripts, don't be afraid to experiment, it's the best way to learn

Thanx Adrianas that really helped
06-20-2013, 04:02 PM
Find
lizardrock17 Offline
Junior Member

Posts: 20
Threads: 3
Joined: Jun 2013
Reputation: 0
#18
RE: Weeping Angel enemies

Quick question. Can a enemy move outside of a script area and keep actions specified by the script?
06-20-2013, 07:14 PM
Find
lizardrock17 Offline
Junior Member

Posts: 20
Threads: 3
Joined: Jun 2013
Reputation: 0
#19
RE: Weeping Angel enemies

void OnStart()
{
SetEntityPlayerLookAtCallback("servant_grunt_1", "WeepingAngel_1", false);
}

void WeepingAngel_1(string &in asEntity, int alState)
{
if(alState == 1)
{
SetEnemyDisabled("servant_grunt_1", bool abDisabled);
}
else if(alState == -1)
{
SetNPCAwake("servant_grunt_1", bool abAwake, bool abEffects);
ShowEnemyPlayerPosition("servant_grunt_1");
}
}


So i have created this code so that the grunt acts like a weeping angel. But when i try to test this i get an error and the solution that comes with the error doesnt help. Can someone telll me what i did wrong.
(This post was last modified: 06-21-2013, 12:47 AM by lizardrock17.)
06-21-2013, 12:45 AM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#20
RE: Weeping Angel enemies

Bool's only evaluates to true or false. So, you need to change the bool's to true or false.

Like this.
Spoiler below!

bool abCode
abCode - determines if you want to use the code or not.
ITS JUST AN EXAMPLE

Let's just say you want to use it.

If you want to use it = true
If you DONT want to use it = false

No quotation's needed.


"Veni, vidi, vici."
"I came, I saw, I conquered."
06-21-2013, 03:42 AM
Find




Users browsing this thread: 1 Guest(s)