Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Regarding Flags (https://forums.graalonline.com/forums/showthread.php?t=134266121)

Gunderak 03-30-2012 09:04 AM

Regarding Flags
 
I am having a little trouble with one of my scripts.
Basically it gets a certain name for instance: goteggs then I want it to check if(clientr.goteggs == 1){ but goteggs is a string, I tried if(clientr.(temp.quest) == 1){ with no luck. Am I doing something wrong?
Thanks.

cbk1994 03-30-2012 12:56 PM

First of all, it sounds like a boolean (based on the name of the variable), so either choose a less misleading name or just do if (variable).

I think you're trying to check the value of a variable whose name you don't know beforehand? This should work:

PHP Code:

temp.varName "foo";
echo(
clientr.(@ temp.varName)); 

I've always used an @ there and thought it was unnecessary, but a quick test reveals that apparently it is necessary.

Gunderak 03-30-2012 01:09 PM

Thanks, and yes it was a boolean, got mixed up.
The @ seems really unnecessary..

Crow 03-30-2012 02:01 PM

Quote:

Originally Posted by Gunderak (Post 1690483)
Thanks, and yes it was a boolean, got mixed up.
The @ seems really unnecessary..

It's not. The @ operator is to make sure the variable gets cast to a string in several places.

fowlplay4 03-30-2012 03:48 PM

You should use clientr.("quest_" @ temp.questvar) instead of just clientr.(@temp.questvar) for the sake of organization in your clientr flags.

Gunderak 03-31-2012 03:41 PM

That's what I am already doing. o.0


All times are GMT +2. The time now is 04:49 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.