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
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


Messages In This Thread
Weeping Angel enemies - by lizardrock17 - 06-19-2013, 04:30 AM
RE: Weeping Angel enemies - by Tomato Cat - 06-19-2013, 05:22 AM
RE: Weeping Angel enemies - by lizardrock17 - 06-19-2013, 05:31 AM
RE: Weeping Angel enemies - by CarnivorousJelly - 06-19-2013, 05:54 AM
RE: Weeping Angel enemies - by DeAngelo - 06-19-2013, 10:36 AM
RE: Weeping Angel enemies - by Adrianis - 06-19-2013, 03:08 PM
RE: Weeping Angel enemies - by lizardrock17 - 06-19-2013, 05:01 PM
RE: Weeping Angel enemies - by Adrianis - 06-19-2013, 05:41 PM
RE: Weeping Angel enemies - by lizardrock17 - 06-19-2013, 05:57 PM
RE: Weeping Angel enemies - by OriginalUsername - 06-19-2013, 06:59 PM
RE: Weeping Angel enemies - by 7heDubz - 06-20-2013, 04:00 AM
RE: Weeping Angel enemies - by OriginalUsername - 06-20-2013, 06:54 AM
RE: Weeping Angel enemies - by 7heDubz - 06-20-2013, 07:18 AM
RE: Weeping Angel enemies - by OriginalUsername - 06-20-2013, 07:36 AM
RE: Weeping Angel enemies - by 7heDubz - 06-20-2013, 07:40 AM
RE: Weeping Angel enemies - by Adrianis - 06-20-2013, 12:57 PM
RE: Weeping Angel enemies - by lizardrock17 - 06-20-2013, 04:02 PM
RE: Weeping Angel enemies - by lizardrock17 - 06-20-2013, 07:14 PM
RE: Weeping Angel enemies - by lizardrock17 - 06-21-2013, 12:45 AM
RE: Weeping Angel enemies - by PutraenusAlivius - 06-21-2013, 03:42 AM
RE: Weeping Angel enemies - by lizardrock17 - 06-21-2013, 03:46 AM
RE: Weeping Angel enemies - by CarnivorousJelly - 06-21-2013, 05:17 AM
RE: Weeping Angel enemies - by PutraenusAlivius - 06-21-2013, 05:52 AM
RE: Weeping Angel enemies - by lizardrock17 - 06-21-2013, 02:59 PM
RE: Weeping Angel enemies - by Adrianis - 06-21-2013, 05:47 PM



Users browsing this thread: 1 Guest(s)