Scripts / Winzone and 2 part quest condition.

Author
Message
SoUlFaThEr
9
Years of Service
User Offline
Joined: 20th Jul 2015
Location:
Posted: 3rd Aug 2015 22:21
2 ai characters, one is a quest giver the other is someone to rescue.

I' having trouble figuring out what to do with this winzone...it just sends a level complete.

I need a special script in it with 2 set global variables where i can say in my winzone_map1.lua ?? :

function winzone_map1_init(e)
end

function winzone_map1_main(e)
if g_Entity[e]['plrinzone']==1 then
if johnnyslapped == 1 and girlembarrassed == 1 then
JumpToLevelIfUsed(e)
end --johnny slapped if closer
end --if player is indeed within this zone closer
end -- function winzone_map1closer

are those simple things actually globals??? I mean, i'm a noob starting to hopefully understand this stuff but if those 2 global variables are set to 1 from 2 different scripts, is this going to work?

or is this better:

function winzone_map1_init(e)
end

function winzone_map1_main(e)
if g_Entity[e]['plrinzone']==1 and johnnyslapped == 1 and girlembarrassed == 1 then
JumpToLevelIfUsed(e)
end --if player is indeed within this zone/johhny got slapped/girl got embarrassed closer
end --function winzone_map1closer


Or would both work....and if so, which one is more efficient.
I just dont know how many logical ANDs, or any other for that matter, can be used in one if statement. Woudl be nice to know this one.

Thanks in advanced.



The only stupid questions are those that were never asked.
PM
SoUlFaThEr
9
Years of Service
User Offline
Joined: 20th Jul 2015
Location:
Posted: 4th Aug 2015 00:35
The top one actually worked and I am extatic for making this work That means I'm learning stuff.

Only poroblem is I added a Prompt ("Level 1 Completed"), but you cant see it because theres another, probably hardcoded, text prompt in the way so it isnt showing mine.
The only stupid questions are those that were never asked.
PM

Login to post a reply

Server time is: 2024-12-22 01:02:49
Your offset time is: 2024-12-22 01:02:49