3 registered members (TipmyPip, AndrewAMD, dBc),
18,430
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
entity.string1, How the hell
#229378
09/26/08 23:52
09/26/08 23:52
|
Joined: Dec 2006
Posts: 1,086 Queensland - Australia
Nidhogg
OP
Serious User
|
OP
Serious User
Joined: Dec 2006
Posts: 1,086
Queensland - Australia
|
Does entity.string1 work with c-script.. I have a simple code
string Unit_Type;
function AI_Fight()
str_cpy(Unit_Type,my.string1)
if(Unit_Type == "guard")
{
do_something;
}
It does NOT work, even tried my.string2 AI just stands there looking stupid at me.. 
Windows XP SP3 Intel Dual Core CPU: E5200 @ 2.5GHz 4.00GB DDR3 Ram ASUS P5G41T-M LX PCIE x16 GeForce GTS 450 1Gb SB Audigy 4 Spyware Doctor with AntiVirus
|
|
|
Re: entity.string1, How the hell
[Re: testDummy]
#229388
09/27/08 04:58
09/27/08 04:58
|
Joined: Sep 2008
Posts: 29
log2
Newbie
|
Newbie
Joined: Sep 2008
Posts: 29
|
yea testDummy is correct, you can't use string1 == string2, you actually have to use str_cmpi in you if statement string Unit_Type;
function AI_Fight()
str_cpy(Unit_Type,my.string1)
if(str_cmpi(Unit_Type, "guard"))
{
do_something;
} That's also case insensitive, aka GUARD would work just as well as guard, if you don't want that, change str_cmpi, to str_cmp
|
|
|
Re: entity.string1, How the hell
[Re: log2]
#229394
09/27/08 06:22
09/27/08 06:22
|
Joined: Dec 2006
Posts: 1,086 Queensland - Australia
Nidhogg
OP
Serious User
|
OP
Serious User
Joined: Dec 2006
Posts: 1,086
Queensland - Australia
|
Many thanks, It's works now..
Windows XP SP3 Intel Dual Core CPU: E5200 @ 2.5GHz 4.00GB DDR3 Ram ASUS P5G41T-M LX PCIE x16 GeForce GTS 450 1Gb SB Audigy 4 Spyware Doctor with AntiVirus
|
|
|
|