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


Thread Rating:
  • 3 Vote(s) - 3.67 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Anyone Need Help? (Thread #2)
zecuro Offline
Member

Posts: 162
Threads: 33
Joined: Jul 2011
Reputation: 3
#21
RE: Anyone Need Help? (Thread #2)

(07-22-2011, 05:25 PM)Kyle Wrote: This thread has been made by me to help anyone who needs to ask a question mostly about scripting. Smile

Also it could help people by those who are looking for some can easily find an active thread that shall be cluttered with people's questions and answers to keep people from painfully have to go through the 100-some pages of threads. Big Grin

Ask away! Wink

yes it would be awesome if you coulg teach me a trick or 2 for basic scripting
07-24-2011, 11:14 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#22
RE: Anyone Need Help? (Thread #2)

(07-24-2011, 11:14 PM)zecuro Wrote: yes it would be awesome if you coulg teach me a trick or 2 for basic scripting

I can really explain something if it is a specific thing you wish to know or understand. Smile

07-25-2011, 12:58 AM
Find
zecuro Offline
Member

Posts: 162
Threads: 33
Joined: Jul 2011
Reputation: 3
#23
RE: Anyone Need Help? (Thread #2)

(07-25-2011, 12:58 AM)Kyle Wrote:
(07-24-2011, 11:14 PM)zecuro Wrote: yes it would be awesome if you coulg teach me a trick or 2 for basic scripting

I can really explain something if it is a specific thing you wish to know or understand. Smile

actually about note and key to open door and basic stuff like that i'm really new to this i have a lot of potentional in drawing so i came up with prettty good visual concept but without script......you cant really create a storyline so plz help

sorry for my bad english
07-25-2011, 07:10 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#24
RE: Anyone Need Help? (Thread #2)

(07-25-2011, 07:10 PM)zecuro Wrote: actually about note and key to open door and basic stuff like that i'm really new to this i have a lot of potentional in drawing so i came up with prettty good visual concept but without script......you cant really create a storyline so plz help

sorry for my bad english

For a custom story to run you need a .hps file with the same name as each map you have for your custom story. Meaning, for example, your map is called "MapName.map", then there will be a file in the same folder called "MapName.hps" that the modder has to make by themselves which then holds all the scripting information about that map.

This is needed for the most simple .hps script file to have the custom story successfully run the map:

void OnStart()
{

}

To unlock a door with a key, you can do this:

void OnStart()
{
    AddUseItemCallback("", "Key01", "Door01", "DoorUnlock", true);
}
void DoorUnlock(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked(asEntity, false, true);
    PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);
    RemoveItem(asItem);
}

The code above unlocks swing doors (doors that the player can open with his hand). "Key01" is the name of the key that unlocks the door. "Door01" is the name of the door the key unlocks. "DoorUnlock" is the name of the function where once it's called unlocks the door, which is the entity. It plays the sound at the door. And it removes the key that unlocks the door.

07-25-2011, 08:50 PM
Find
zecuro Offline
Member

Posts: 162
Threads: 33
Joined: Jul 2011
Reputation: 3
#25
RE: Anyone Need Help? (Thread #2)

(07-25-2011, 08:50 PM)Kyle Wrote:
(07-25-2011, 07:10 PM)zecuro Wrote: actually about note and key to open door and basic stuff like that i'm really new to this i have a lot of potentional in drawing so i came up with prettty good visual concept but without script......you cant really create a storyline so plz help

sorry for my bad english

For a custom story to run you need a .hps file with the same name as each map you have for your custom story. Meaning, for example, your map is called "MapName.map", then there will be a file in the same folder called "MapName.hps" that the modder has to make by themselves which then holds all the scripting information about that map.

This is needed for the most simple .hps script file to have the custom story successfully run the map:

void OnStart()
{

}

To unlock a door with a key, you can do this:

void OnStart()
{
    AddUseItemCallback("", "Key01", "Door01", "DoorUnlock", true);
}
void DoorUnlock(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked(asEntity, false, true);
    PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);
    RemoveItem(asItem);
}

The code above unlocks swing doors (doors that the player can open with his hand). "Key01" is the name of the key that unlocks the door. "Door01" is the name of the door the key unlocks. "DoorUnlock" is the name of the function where once it's called unlocks the door, which is the entity. It plays the sound at the door. And it removes the key that unlocks the door.

thanks you so much last little question when i start the game i got a message like this
fatal error:could not load script file
custom stories/priest/maps/ch00/third test.hps'!
main (1, 1):unexpected token'('
link to the scrpt:http://www.mediafire.com/?f8wn3jxbze7ygz3
07-25-2011, 09:29 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#26
RE: Anyone Need Help? (Thread #2)

(07-25-2011, 09:29 PM)zecuro Wrote: thanks you so much last little question when i start the game i got a message like this
fatal error:could not load script file
custom stories/priest/maps/ch00/third test.hps'!
main (1, 1):unexpected token'('
link to the scrpt:http://www.mediafire.com/?f8wn3jxbze7ygz3

Please just copy your script and paste it right here in the reply box. Smile

It's much more easier to look at that doesn't include any sort of download.

07-25-2011, 09:44 PM
Find
zecuro Offline
Member

Posts: 162
Threads: 33
Joined: Jul 2011
Reputation: 3
#27
RE: Anyone Need Help? (Thread #2)

(07-25-2011, 09:44 PM)Kyle Wrote:
(07-25-2011, 09:29 PM)zecuro Wrote: thanks you so much last little question when i start the game i got a message like this
fatal error:could not load script file
custom stories/priest/maps/ch00/third test.hps'!
main (1, 1):unexpected token'('
link to the scrpt:http://www.mediafire.com/?f8wn3jxbze7ygz3

Please just copy your script and paste it right here in the reply box. Smile

It's much more easier to look at that doesn't include any sort of download.
void OnStart()
{
FadeOut(0);
FadeIn(20);
FadeImageTrailTo(2, 2);
FadeSepiaColorTo(100, 4);
SetPlayerActive(false);
FadePlayerRollTo(50, 220, 220);
FadeRadialBlurTo(0.15, 2);
SetPlayerCrouching(true);
AddTimer("trig1", 7.0f, "beginStory");
}

void beginStory(string &in asTimer)
{
ChangePlayerStateToNormal();
SetPlayerActive(true);
FadePlayerRollTo(0, 33, 33);
FadeRadialBlurTo(0.0, 1);
FadeSepiaColorTo(0, 4);
SetPlayerCrouching(false);
FadeImageTrailTo(0,1);
}
07-25-2011, 10:26 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#28
RE: Anyone Need Help? (Thread #2)

Try this:

void OnStart()
{
    FadeOut(0);
    FadeIn(20);
    FadeImageTrailTo(2, 2);
    FadeSepiaColorTo(100, 4);
    SetPlayerActive(false);
    FadePlayerRollTo(50, 220, 220);
    FadeRadialBlurTo(0.15, 2);
    SetPlayerCrouching(true);
    AddTimer("", 7, "beginStory");
}
void beginStory(string &in asTimer)
{
    ChangePlayerStateToNormal();
    SetPlayerActive(true);
    FadePlayerRollTo(0, 33, 33);
    FadeRadialBlurTo(0, 1);
    FadeSepiaColorTo(0, 4);
    SetPlayerCrouching(false);
    FadeImageTrailTo(0, 1);
}

07-25-2011, 10:49 PM
Find
zecuro Offline
Member

Posts: 162
Threads: 33
Joined: Jul 2011
Reputation: 3
#29
RE: Anyone Need Help? (Thread #2)

(07-25-2011, 10:49 PM)Kyle Wrote: Try this:

void OnStart()
{
    FadeOut(0);
    FadeIn(20);
    FadeImageTrailTo(2, 2);
    FadeSepiaColorTo(100, 4);
    SetPlayerActive(false);
    FadePlayerRollTo(50, 220, 220);
    FadeRadialBlurTo(0.15, 2);
    SetPlayerCrouching(true);
    AddTimer("", 7, "beginStory");
}
void beginStory(string &in asTimer)
{
    ChangePlayerStateToNormal();
    SetPlayerActive(true);
    FadePlayerRollTo(0, 33, 33);
    FadeRadialBlurTo(0, 1);
    FadeSepiaColorTo(0, 4);
    SetPlayerCrouching(false);
    FadeImageTrailTo(0, 1);
}
still dosen't work...
07-25-2011, 10:55 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#30
RE: Anyone Need Help? (Thread #2)

void OnStart()
{
    FadeOut(0);
    FadeIn(20);
    FadeImageTrailTo(2, 2);
    FadeSepiaColorTo(100, 4);
    SetPlayerActive(false);
    FadePlayerRollTo(50, 220, 220);
    FadeRadialBlurTo(0.15, 2);
    SetPlayerCrouching(true);
    AddTimer("", 7, "beginStory");
}
void beginStory(string &in asTimer)
{
    ChangePlayerStateToNormal();
    SetPlayerActive(true);
    FadePlayerRollTo(0, 33, 33);
    FadeRadialBlurTo(0, 1);
    FadeSepiaColorTo(0, 4);
    SetPlayerCrouching(false);
    FadeImageTrailTo(0, 1);
}
void OnEnter()
{
}
void OnLeave()
{
}

Maybe now?

07-25-2011, 10:59 PM
Find




Users browsing this thread: 1 Guest(s)