The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
A local variable int bug
Radical Batz Offline
Posting Freak

Posts: 953
Threads: 145
Joined: Dec 2013
Reputation: 25
#1
A local variable int bug

I am doing a script fuction using addlocals!
Now the script is supposed to check that the player got 2 variable locals, and when he got those 2 then a function will occur which i did here OnEnter:

PHP Code: (Select All)
if(GetLocalVarInt("getit") == 2)
 {
    
SetEntityActive("CaveIn_1"true);
    
AddDebugMessage("2globalshavebeenfound"true);
 } 

For the first local, you need to pick up a key which in the callback func of pickup, it will activate this script
PHP Code: (Select All)
void pickkey(string &in asEntitystring &in asType)
{
    
AddDebugMessage("1global"true);
    
AddLocalVarInt("getit"1);  


And for the 2nd local, you need to use an item on an object by using an adduseitem callback which activates this function here
PHP Code: (Select All)
void animation(string &in asItemstring &in asEntity)
{
    
RemoveItem(asItem);
    
AddDebugMessage("1global"true);
    
CompleteQuest("bucket""bucket");
    
CreateParticleSystemAtEntity("splashps""ps_impact_water_low.ps"asEntityfalse);
    
PlayGuiSound("mizu"1);
    
GiveItem("wooden_bucket_filled""wooden_bucket_filled""water""wooden_bucket_filled.tga"1);
    
SetMessage("Messages""bucketss"2);
    
AddLocalVarInt("getit"1);  


I added a debug message everytime a player gets a variable, also when the 2 are called as I shown on enter but it does not work. The debug message also doesn't play when it checks "if(GetLocalVarInt("getit") == 2)"

Is there anything wrong or missing that is causing this mind blowing error? When in game there are no errors and crashes that occur while testing this.
The map updates and the script too, so no worries.

thnx

(This post was last modified: 05-28-2015, 11:10 AM by Radical Batz.)
05-28-2015, 11:09 AM
Find


Messages In This Thread
A local variable int bug - by Radical Batz - 05-28-2015, 11:09 AM
RE: A local variable int bug - by Kreekakon - 05-28-2015, 11:25 AM
RE: A local variable int bug - by Romulator - 05-28-2015, 11:25 AM
RE: A local variable int bug - by Mudbill - 05-28-2015, 03:44 PM
RE: A local variable int bug - by Radical Batz - 05-28-2015, 05:16 PM



Users browsing this thread: 1 Guest(s)