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 Collide function issue
burge4150 Offline
Member

Posts: 56
Threads: 15
Joined: Feb 2014
Reputation: 0
#3
RE: Collide function issue

A little bug I've found when referencing script areas (or items) through for loop variables:

Yours:
PHP Code: (Select All)
for(int i=1i<=28; ++iAddEntityCollideCallback("Player""ScriptArea_"+i"Diecollide"false1); 

The way that I have to do it to make it work:
PHP Code: (Select All)
for(int i=1i<=28; ++iAddEntityCollideCallback("Player""ScriptArea_"+i+"""Diecollide"false1); 

(One other thing - I've never included the "int" in the for loop declaration. Not sure if that's the issue or not because I'm not familiar with it.)


Note the change in ScriptArea"+i, adding the second + and empty quotes "" has fixed this same issue for me multiple times.

Give it a shot and let me know. I'm pretty sure this will fix things for you.

For further reference, one of my own functions to do something exactly the same:
PHP Code: (Select All)
void InitAreas()
{

int x=1;
for(
x=1x<=20x++)
{

AddEntityCollideCallback("Player""NoiseArea_"+x+"""ScareySound"true1);

}


(This post was last modified: 09-18-2014, 05:19 AM by burge4150.)
09-18-2014, 05:09 AM
Find


Messages In This Thread
Collide function issue - by Radical Batz - 09-17-2014, 10:53 PM
RE: Collide function issue - by Daemian - 09-18-2014, 01:44 AM
RE: Collide function issue - by Radical Batz - 09-18-2014, 07:34 AM
RE: Collide function issue - by burge4150 - 09-18-2014, 05:09 AM
RE: Collide function issue - by i3670 - 09-18-2014, 06:20 AM
RE: Collide function issue - by Mudbill - 09-18-2014, 07:27 AM
RE: Collide function issue - by PutraenusAlivius - 09-18-2014, 08:15 AM
RE: Collide function issue - by Mudbill - 09-18-2014, 08:44 AM
RE: Collide function issue - by PutraenusAlivius - 09-18-2014, 09:04 AM
RE: Collide function issue - by Wapez - 09-18-2014, 08:51 AM
RE: Collide function issue - by Radical Batz - 09-18-2014, 09:04 AM
RE: Collide function issue - by MrBehemoth - 09-18-2014, 09:22 AM
RE: Collide function issue - by Mudbill - 09-18-2014, 09:24 AM
RE: Collide function issue - by Radical Batz - 09-18-2014, 09:31 AM
RE: Collide function issue - by Mudbill - 09-18-2014, 09:59 AM
RE: Collide function issue - by Radical Batz - 09-18-2014, 10:23 AM
RE: Collide function issue - by Radical Batz - 09-18-2014, 02:09 PM
RE: Collide function issue - by burge4150 - 09-18-2014, 02:28 PM
RE: Collide function issue - by PutraenusAlivius - 09-18-2014, 02:31 PM
RE: Collide function issue - by Radical Batz - 09-18-2014, 02:33 PM



Users browsing this thread: 1 Guest(s)