Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 5 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Looking For Help? Look No More!
Legato Offline
Junior Member

Posts: 10
Threads: 2
Joined: Aug 2011
Reputation: 0
#11
RE: Looking For Help? Look No More!

Hey thanks for offering to help! I'm creating a mod right now with pretty different enemy behavior. The problem I'm having however isn't with the scripting.

Basically, I need a monster that doesn't have any animations, yet uses the grunt AI to walk around and attack (the idea is for the monster to move slowly, seeming to float toward the player). While I'll be using my own model for the final product (a cloaked figure, you can't see its feet, hence you lack of a need for actual animation), I've tried practicing on existing monsters and inanimate entities, but any time I tinker with removing the animations, the monster does not move at all, or causes a bug during play, or the modelEditor disallows saving.

Any ideas?

My first priority will always be to Chaos.
08-28-2011, 10:42 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#12
RE: Looking For Help? Look No More!

(08-28-2011, 10:42 PM)Legato Wrote: Any ideas?
You may want to look at the dead corpse entity. Although it doesn't damage the player, it does follow the player really well--perhaps too well.

Tutorials: From Noob to Pro
08-28-2011, 11:52 PM
Website Find
Legato Offline
Junior Member

Posts: 10
Threads: 2
Joined: Aug 2011
Reputation: 0
#13
RE: Looking For Help? Look No More!

Oh is there scripting for having an entity follow you around?! Care to share?

In order for that to work I'd also need to get an entity to attack the player when it gets close. That's why I thought using an enemy was the way to go...



(08-28-2011, 11:52 PM)Your Computer Wrote:
(08-28-2011, 10:42 PM)Legato Wrote: Any ideas?
You may want to look at the dead corpse entity. Although it doesn't damage the player, it does follow the player really well--perhaps too well.


My first priority will always be to Chaos.
(This post was last modified: 08-29-2011, 12:54 AM by Legato.)
08-29-2011, 12:54 AM
Find
Tesseract Offline
Senior Member

Posts: 498
Threads: 7
Joined: Mar 2011
Reputation: 18
#14
RE: Looking For Help? Look No More!

Hi Kyle

ive been toying around with if statements and ive made a door open.

void StateChange(string &in EntityName, int alState)
{
if(alState == -1){
SetMoveObjectState("safety_normal_vert_1", 0.1);
}
if(alState != -1){
SetMoveObjectState("safety_normal_vert_1", 0.0);
}
}

it works but the door moves straight back to its original position, why is this?
08-29-2011, 11:53 AM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#15
RE: Looking For Help? Look No More!

(08-29-2011, 11:53 AM)Saffire192 Wrote: Hi Kyle

ive been toying around with if statements and ive made a door open.

void StateChange(string &in EntityName, int alState)
{
if(alState == -1){
SetMoveObjectState("safety_normal_vert_1", 0.1);
}
if(alState != -1){
SetMoveObjectState("safety_normal_vert_1", 0.0);
}
}

it works but the door moves straight back to its original position, why is this?

If you don't want that to happen, have it set with static physics once it completely opens.

void StateChange(string &in EntityName, int alState)
{
     if(alState == -1){
          SetMoveObjectState("safety_normal_vert_1", 0.1);
     }
     if(alState != -1){
          SetMoveObjectState("safety_normal_vert_1", 0.0);
          SetStaticPhysics("safety_normal_vert_1", true);
     }
}

This should work, unless I messed up the alStates. Tongue

08-29-2011, 12:51 PM
Find
Tesseract Offline
Senior Member

Posts: 498
Threads: 7
Joined: Mar 2011
Reputation: 18
#16
RE: Looking For Help? Look No More!

the door just seems to still fall back to its position, i think it might be what it is supposed to do im going to try using a secret doorway just to test if it does the same thing, thanks for the help btw Smile


i figured it out Big Grin
i just used a different type of door i fell happy now :3
(This post was last modified: 08-29-2011, 01:54 PM by Tesseract.)
08-29-2011, 01:16 PM
Find
rybray Offline
Junior Member

Posts: 31
Threads: 9
Joined: Aug 2011
Reputation: 1
#17
RE: Looking For Help? Look No More!

I would like to know how global variables work, the Wiki didn't help me very much and there dont seem to be good youtube tutorials (id love to make one...if i understood how they worked).

Global variables: what are they, how do they work? What functions do they have in a custom story?
08-29-2011, 05:18 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#18
RE: Looking For Help? Look No More!

(08-29-2011, 05:18 PM)rybray Wrote: I would like to know how global variables work, the Wiki didn't help me very much and there dont seem to be good youtube tutorials (id love to make one...if i understood how they worked).

Global variables: what are they, how do they work? What functions do they have in a custom story?

Global variables are like any other variable, but more like a local variable. Wink

Normal Variable: int x = 5;
Local Variable: SetLocalVarInt("x", 5);
Global Variable: SetGlobalVarInt("x", 5);

Global variables are used in a custom story to "connect" all the maps together in a sense. Lets say you pick a path between two on a map called "Map01". The path you pick leads you back to the same track you were on where these two paths join up again. If you played Gears of War, then you'll know what I'm talking about. But let's say the path you choose alters later gameplay. Lets say there's a monster boss at the end of the game. If you choose "Path01", then you have found the monster's weakness, else if you chose "Path02", then you didn't do what you did when going to "Path01". But the boss is in "Map02", the second map.

The computer needs to transfer the data of the choice you made in "Map01" to "Map02" where you fight the boss. This is why there are global variables so that data can be altered throughout multiple maps in a custom story without worrying about the connection between all of them.

To set up global variables, you need to make sure that you make a file in your custom story's "maps" folder called "global.hps". Where the ending extension is ".hps" and isn't part of the actual name. In there, you can set a global variable up like this:

void OnGameStart()
{
     SetGlobalVarInt("Global01", 0);
}

Then you can access this data in whatever script files for your maps are, which should be in the same folder with this "global.hps". You can use "AddGlobalVarInt("Global01", 1);" to chance the value of it much like the way local variables work.

I hope this helps you, and if you have any questions, ask away! Smile

08-29-2011, 05:54 PM
Find
rybray Offline
Junior Member

Posts: 31
Threads: 9
Joined: Aug 2011
Reputation: 1
#19
RE: Looking For Help? Look No More!

(08-29-2011, 05:54 PM)Kyle Wrote:
(08-29-2011, 05:18 PM)rybray Wrote: I would like to know how global variables work, the Wiki didn't help me very much and there dont seem to be good youtube tutorials (id love to make one...if i understood how they worked).

Global variables: what are they, how do they work? What functions do they have in a custom story?

Global variables are like any other variable, but more like a local variable. Wink

Normal Variable: int x = 5;
Local Variable: SetLocalVarInt("x", 5);
Global Variable: SetGlobalVarInt("x", 5);

Global variables are used in a custom story to "connect" all the maps together in a sense. Lets say you pick a path between two on a map called "Map01". The path you pick leads you back to the same track you were on where these two paths join up again. If you played Gears of War, then you'll know what I'm talking about. But let's say the path you choose alters later gameplay. Lets say there's a monster boss at the end of the game. If you choose "Path01", then you have found the monster's weakness, else if you chose "Path02", then you didn't do what you did when going to "Path01". But the boss is in "Map02", the second map.

The computer needs to transfer the data of the choice you made in "Map01" to "Map02" where you fight the boss. This is why there are global variables so that data can be altered throughout multiple maps in a custom story without worrying about the connection between all of them.

To set up global variables, you need to make sure that you make a file in your custom story's "maps" folder called "global.hps". Where the ending extension is ".hps" and isn't part of the actual name. In there, you can set a global variable up like this:

void OnGameStart()
{
     SetGlobalVarInt("Global01", 0);
}

Then you can access this data in whatever script files for your maps are, which should be in the same folder with this "global.hps". You can use "AddGlobalVarInt("Global01", 1);" to chance the value of it much like the way local variables work.

I hope this helps you, and if you have any questions, ask away! Smile

I'm glad you mention GoW, because I probably wouldn't have understood unless you said that Big Grin

So by using the "AddGlobalVarInt("Global01", 1);" you change its value from 0 to 1, causing whatever you want to happen. It seems like this can be used to create branching story paths in custom stories, to an extent at least.

If you wanted larger changes to occur in a map, would it make more sense just to take the map and script file and just alter them totally and have the new map load instead of writing script for global variables?
08-29-2011, 06:11 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#20
RE: Looking For Help? Look No More!

(08-29-2011, 06:11 PM)rybray Wrote: So by using the "AddGlobalVarInt("Global01", 1);" you change its value from 0 to 1, causing whatever you want to happen. It seems like this can be used to create branching story paths in custom stories, to an extent at least.

Yes, of course. Smile

(08-29-2011, 06:11 PM)rybray Wrote: If you wanted larger changes to occur in a map, would it make more sense just to take the map and script file and just alter them totally and have the new map load instead of writing script for global variables?

If you're suggesting changing all the local variables into global variables, that's your choice, but it may be a bit more messier in some cases. Smile

08-29-2011, 06:19 PM
Find




Users browsing this thread: 5 Guest(s)