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
Question: Scripting with a (*)
Rapture Offline
Posting Freak

Posts: 1,078
Threads: 79
Joined: May 2011
Reputation: 30
#1
Question: Scripting with a (*)

Can anyone explain in more detail with the use of a * in scripting for Amensia? My code is fine in working, except when I tried to change this one part from a 1 to a *.
AddPropImpulse("FloatBox_*", RandFloat(-2,2), 1.1, RandFloat(-2,2), "");

It works for the
SetEntityInteractionDisabled("FloatBox_*", true);
fine. But not for the AddPropImpulse?

So what's wrong with it? You can see now I'm trying to manually put in junk lines to get the boxes to work. But I'm planning to have over 200+ boxes, and I don't want to fill up the .hps with more lines if I can help it.

void OnStart()
{  
AddTimer("FloatTime", 0.01, "FloatObjects");

SetEntityInteractionDisabled("FloatBox_*", true);

AddEntityCollideCallback("Player", "BoxActivate_1", "BoxActivate_1_Start", true, 1);
}
void Intro()
{

}

void OnEnter()
{

}
//**********************************************************************************
void BoxActivate_1_Start(string &in asParent, string &in asChild, int alState)
{
AddTimer("FloatObjects1", 0.01, "FloatObjects1");
}

void FloatObjects1(string &in asTimer)
{
    AddPropImpulse("FloatBox_*", RandFloat(-2,2), 1.1, RandFloat(-2,2), "");
//  AddPropImpulse("FloatBox_2", RandFloat(-2,2), 1.1, RandFloat(-2,2), "");
//  AddPropImpulse("FloatBox_3", RandFloat(-2,2), 1.1, RandFloat(-2,2), "");
//  AddPropImpulse("FloatBox_4", RandFloat(-2,2), 1.1, RandFloat(-2,2), "");
//  AddPropImpulse("FloatBox_5", RandFloat(-2,2), 1.1, RandFloat(-2,2), "");
//  AddPropImpulse("FloatBox_6", RandFloat(-2,2), 1.1, RandFloat(-2,2), "");
//  AddPropImpulse("FloatBox_7", RandFloat(-2,2), 1.1, RandFloat(-2,2), "");
//  AddPropImpulse("FloatBox_8", RandFloat(-2,2), 1.1, RandFloat(-2,2), "");
//  AddPropImpulse("FloatBox_10", RandFloat(-2,2), 1.1, RandFloat(-2,2), "");
//  AddPropImpulse("FloatBox_12", RandFloat(-2,2), 1.1, RandFloat(-2,2), "");
//  AddPropImpulse("FloatBox_13", RandFloat(-2,2), 1.1, RandFloat(-2,2), "");
//  AddPropImpulse("FloatBox_14", RandFloat(-2,2), 1.1, RandFloat(-2,2), "");
//  AddPropImpulse("FloatBox_15", RandFloat(-2,2), 1.1, RandFloat(-2,2), "");
//  AddPropImpulse("FloatBox_16", RandFloat(-2,2), 1.1, RandFloat(-2,2), "");
//  AddPropImpulse("FloatBox_17", RandFloat(-2,2), 1.1, RandFloat(-2,2), "");
//  AddPropImpulse("FloatBox_18", RandFloat(-2,2), 1.1, RandFloat(-2,2), "");
//  AddPropImpulse("FloatBox_19", RandFloat(-2,2), 1.1, RandFloat(-2,2), "");
//  AddPropImpulse("FloatBox_20", RandFloat(-2,2), 1.1, RandFloat(-2,2), "");
//  AddPropImpulse("FloatBox_21", RandFloat(-2,2), 1.1, RandFloat(-2,2), "");
//  AddPropImpulse("FloatBox_22", RandFloat(-2,2), 1.1, RandFloat(-2,2), "");
//  AddPropImpulse("FloatBox_23", RandFloat(-2,2), 1.1, RandFloat(-2,2), "");
//  AddPropImpulse("FloatBox_24", RandFloat(-2,2), 1.1, RandFloat(-2,2), "");
//  AddPropImpulse("FloatBox_25", RandFloat(-2,2), 1.1, RandFloat(-2,2), "");
//  AddPropImpulse("FloatBox_26", RandFloat(-2,2), 1.1, RandFloat(-2,2), "");
//  AddPropImpulse("FloatBox_27", RandFloat(-2,2), 1.1, RandFloat(-2,2), "");
//  AddPropImpulse("FloatBox_28", RandFloat(-2,2), 1.1, RandFloat(-2,2), "");
//  AddPropImpulse("FloatBox_29", RandFloat(-2,2), 1.1, RandFloat(-2,2), "");
//  AddPropImpulse("FloatBox_30", RandFloat(-2,2), 1.1, RandFloat(-2,2), "");
    
    AddTimer("FloatTime", 0.1, "FloatObjects1");
}
11-27-2011, 05:46 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#2
RE: Question: Scripting with a (*)

Not all functions support the asterisk wildcard. Better support for this wildcard will be included in HPL3, though. You may have to go with a for loop instead.

Tutorials: From Noob to Pro
11-27-2011, 08:36 AM
Website Find




Users browsing this thread: 1 Guest(s)