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
Could I get some assistance with these if's?
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#1
Could I get some assistance with these if's?

Okay, I have declared some stuff up top.
PHP Code: (Select All)
AddEntityCollideCallback("Player""CanBuild""PlaceLadder"false0);
AddCombineCallback("""Half_Ladder_1""Half_Ladder_2""BuildLadder"true);
SetLocalVarInt("CanBuildLadder"0); 

Then I have worked the functions down the bottom. I have used Local Vars because I cannot check.. well, I don't think I can do what I wanted in a simpler method. Basically I want to be able to combine two ladder parts together (Justine items) to make one larger ladder item, but that ladder can only be put together within a certain script area, because it would technically be too big to hold in the inventory Tongue

In order to check if the player is in the Script Area, I change the Local Var to 1, and if the player is not in the area, it becomes 0.

PHP Code: (Select All)
void PlaceLadder(string &in asParentstring &in asChildint alState)
{
    if(
alState == 1)
        {
        
SetLocalVarInt("CanBuildLadder"1);
        }
        else
        {
        
SetLocalVarInt("CanBuildLadder"0);
        }
}
        
void BuildLadder(string &in asItemAstring &in asItemB)
{
    if (
GetLocalVarInt("CanBuildLadder") == 1)
        {
        
SetEntityActive("LadderArea_1"true);
        
SetEntityActive("ladder_static_1"true);
        }


The errors returned are:
(210, 2) Expected "," or ";"
(214, 3) Unexpected Token else
(220, 2) Expected "," or ";"

Line 210 is if(alState == 1)

If needed, I can and will post the whole code Smile

Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 10-02-2013, 05:39 PM by Romulator.)
10-02-2013, 09:19 AM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#2
RE: Could I get some assistance with these if's?

- AddCombineCallback is only usable in Inventory.hps IIRC.
- Use AddLocalVarInt instead of using SetLocalVarInt.

"Veni, vidi, vici."
"I came, I saw, I conquered."
10-02-2013, 09:22 AM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#3
RE: Could I get some assistance with these if's?

Gave it a go and
Gave up Tongue

So instead, I'll just make it so you can place the ladders in the appropriate spot in order to make a larger ladder.

Marked as solved Smile

Discord: Romulator#0001
[Image: 3f6f01a904.png]
10-02-2013, 05:38 PM
Find




Users browsing this thread: 1 Guest(s)