Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Need help with var script

Author
Message
yashasp9
12
Years of Service
User Offline
Joined: 29th May 2012
Location:
Posted: 20th May 2013 08:46
I have placed 4 targets in my level and all 4 are destroyed,a door should open.Here are the scripts

Trigger zone for declaring variables


The targets


The Door


I have used activated=2 for something else.

When I shoot all 4 targets nothing happens,only the targets get destroyed.But the door doesnt open. What am I Doing Wrong?
Burger
12
Years of Service
User Offline
Joined: 22nd Jun 2012
Location: New Zealand
Posted: 20th May 2013 09:15
Quote: ":state=0,shotdamage=4:addvar=Shot 1"


Where is this line located? If it were me, I'd tag addvar=shot 1 onto the death script.

I'm not particularly sure if there's a mistake in the trigger zone code as I don't tend to use the settarget or activate target commands. A potential work around is instead of using those commands do this:



And you'd simply change the door script to be like:



In theory, that should work just the same? This is all based on the idea that the 'Shot' variable will only be used in that situation, and since you know that variable will be 10 it can be used to your advantage. If you know its 10 then the door should be opened, because the previous conditions are met.

It may not be the tidiest use of a variable, but it my games I often use the same variable the progress is linear. It helps me keep track of things because I can very easily point out the flaws of a script. Even if it goes beyond the original intent or meaning of the variable itself, it still works.

- An Instinctive Fear IndieDB page, download demo today!
yashasp9
12
Years of Service
User Offline
Joined: 29th May 2012
Location:
Posted: 20th May 2013 09:46
Thanks i'll try it
yashasp9
12
Years of Service
User Offline
Joined: 29th May 2012
Location:
Posted: 20th May 2013 09:51 Edited at: 20th May 2013 10:04
It isnt working I dont know why.Is the destroy script proper?
]

Edit:I have attached a screenshot of the placement.

Attachments

Login to view attachments
Corno_1
14
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 20th May 2013 12:03
There are so many ways to do this and you use just one. Think again over your scripts, change something and look what it does.

Use this for the door:


and this for the targets:


I can not promise, but it should work!


yashasp9
12
Years of Service
User Offline
Joined: 29th May 2012
Location:
Posted: 20th May 2013 17:01
It still doesn't work.
This my Door script


And For each Target
Corno_1
14
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 20th May 2013 21:49
So after some testing, I find out how it works:

Use this for your door as main:

and this for your target as destroy:

I tested it with the standart scifi barrels and it works, so I hope it works for you too.

I see your are one of this trainning pack team(screenshot). How it works all?


yashasp9
12
Years of Service
User Offline
Joined: 29th May 2012
Location:
Posted: 21st May 2013 05:54 Edited at: 21st May 2013 05:59
Thanks it worked! But there is one problem the targets dont dissappear or get destroyed they just stay there. but the variables are working and the door is opening after Ihit all 4 of them.

I didnt understand what your last question was.

Edit:I just added destroy to the target script and it worked but there is a slight delay for the door to open.But thats not a big deal.
Corno_1
14
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 21st May 2013 12:14 Edited at: 21st May 2013 12:15
Good to hear! Forget my question! If you want that the door opens imediatly use activate commands. Var commands have time laggs. But I am not sure if you can make something like this with activateifused or similar.

Edit: you can do it, but it needs a lot more lines!

Maybe cover this time lagg with a sentence like:"Now the door is open"


yashasp9
12
Years of Service
User Offline
Joined: 29th May 2012
Location:
Posted: 21st May 2013 12:59
Yeah Thanks! Can you help me with this http://forum.thegamecreators.com/?m=forum_view&t=205627&b=23

Login to post a reply

Server time is: 2024-11-23 14:28:28
Your offset time is: 2024-11-23 14:28:28