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 D: please
Juby Away
Senior Member

Posts: 290
Threads: 2
Joined: May 2011
Reputation: 5
#10
RE: Script help D: please

HPL2 is a very easy language to learn. I am self-taught, so I'll explain how I did it;
I started with this - http://wiki.frictionalgames.com/hpl2/tut...cks_a_door
Bookmarked this -
http://wiki.frictionalgames.com/hpl2/amn..._functions
Did this -
http://wiki.frictionalgames.com/hpl2/thi...xt/notepad
Then experimented a whole lot. Starting with trying to resemble some game scripts I've read.

Look at this: (HPL)
Spoiler below!

void InteractLargeGate(string &in asEntity)
{
PlaySoundAtEntity("guardboo", "guardian_distant1", "AreaLargeGate", 3.0f, false);
PlaySoundAtEntity("thunderboo", "general_thunder.snt", "AreaLargeGate", 0.0f, false);

PlayGuiSound("close_gate.ogg", 0.4f);

AddTimer("1", 0.4f, "TimerLargeGate");
AddTimer("2", 0.1f, "TimerLargeGate");
AddTimer("3", 0.6f, "TimerLargeGate");
AddTimer("4", 2.0f, "TimerLargeGate");
}

Then this: (GSC)
Spoiler below!


while(1)
{
players = get_players();
for(i=0;i {

weap = players[i] getcurrentweapon();
if(!isDefined(weap) || weap == "none" || weap == "zombie_perk_bottle_doubletap" || weap == "zombie_perk_bottle_jugg" || weap == "zombie_perk_bottle_revive" || weap == "zombie_perk_bottle_sleight" || weap == "mine_bouncing_betty" || weap == "syrette" || weap == "zombie_knuckle_crack" || weap == "zombie_bowie_flourish" )
{
continue;
}
if ( players[i] GetAmmoCount( weap ) > 5)
{
continue;
}
if ( players[i] maps\_laststand::player_is_in_laststand() )
{
continue;
}
else if (players[i] GetAmmoCount( weap ) < 5 && players[i] GetAmmoCount( weap ) > 0)
{
if (level.player_ammo_low == 0)
{
level.player_ammo_low = 1;
players[i] thread add_low_ammo_dialog();
players[i] thread ammo_dialog_timer();
level waittill("send_dialog_reminder");
level.player_ammo_low = 0;
}

}
else if (players[i] GetAmmoCount( weap ) == 0)
{
if(!isDefined(weap) || weap == "none")
{
continue;
}
level.player_ammo_out = 1;
players[i] thread add_no_ammo_dialog( weap );
wait(20);
level.player_ammo_out = 0;
}
else
{
continue;
}
}
wait(.5);
}


HPL2 can become very advanced if you know what you're doing, but almost all of that is not particularly useful. A great story can be made with an average scripting knowledge. Keep experimenting and finding out what works and what doesn't. Even try to make what you wrote as compact as possible. Learning scripting is great because you can do what you want to do Wink

But, sometimes people just can't learn alone, so...feel free to PM me questions you may have.

Insanity. Static.
(This post was last modified: 07-10-2012, 11:42 AM by Juby.)
07-09-2012, 03:29 PM
Find


Messages In This Thread
Script help D: please - by Ravenxx - 07-08-2012, 05:41 PM
RE: Script help D: please - by Mine Turtle - 07-08-2012, 07:58 PM
RE: Script help D: please - by Ravenxx - 07-08-2012, 09:07 PM
RE: Script help D: please - by EXAWOLT - 07-08-2012, 08:58 PM
RE: Script help D: please - by Adny - 07-08-2012, 09:33 PM
RE: Script help D: please - by Mine Turtle - 07-08-2012, 11:17 PM
RE: Script help D: please - by Kazakarumariou - 07-09-2012, 12:45 AM
RE: Script help D: please - by Adny - 07-09-2012, 12:59 AM
RE: Script help D: please - by Kazakarumariou - 07-09-2012, 02:01 AM
RE: Script help D: please - by Juby - 07-09-2012, 03:29 PM



Users browsing this thread: 1 Guest(s)