zecuro
Member
Posts: 162
Threads: 33
Joined: Jul 2011
Reputation:
3
|
RE: Anyone Need Help? (Thread #2)
|
|
07-24-2011, 11:14 PM |
|
Kyle
Posting Freak
Posts: 911
Threads: 36
Joined: Sep 2010
Reputation:
7
|
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.
|
|
07-25-2011, 12:58 AM |
|
zecuro
Member
Posts: 162
Threads: 33
Joined: Jul 2011
Reputation:
3
|
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.
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 |
|
Kyle
Posting Freak
Posts: 911
Threads: 36
Joined: Sep 2010
Reputation:
7
|
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:
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 |
|
zecuro
Member
Posts: 162
Threads: 33
Joined: Jul 2011
Reputation:
3
|
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:
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 |
|
Kyle
Posting Freak
Posts: 911
Threads: 36
Joined: Sep 2010
Reputation:
7
|
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.
It's much more easier to look at that doesn't include any sort of download.
|
|
07-25-2011, 09:44 PM |
|
zecuro
Member
Posts: 162
Threads: 33
Joined: Jul 2011
Reputation:
3
|
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.
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 |
|
Kyle
Posting Freak
Posts: 911
Threads: 36
Joined: Sep 2010
Reputation:
7
|
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 |
|
zecuro
Member
Posts: 162
Threads: 33
Joined: Jul 2011
Reputation:
3
|
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 |
|
Kyle
Posting Freak
Posts: 911
Threads: 36
Joined: Sep 2010
Reputation:
7
|
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 |
|
|