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 / !!!Help is needed!!! How to activate script trough an entity, or a zone? (objectives)

Author
Message
Jonez Games
14
Years of Service
User Offline
Joined: 19th Feb 2010
Location: Finland
Posted: 6th Oct 2010 01:53 Edited at: 6th Oct 2010 01:58
So, I got an objectives script, but I dont want it to be show until you first activate it trough a trigger zone or picking up item... etc. (also, I could easily add new objectives with this)

The script is here:



Can some one help me with this?(or... is it even possible to make?)

Thanks

Jonez

Seth Black
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 22nd Feb 2005
Location: Pittsburgh, PA
Posted: 6th Oct 2010 02:04
...getting very close.

1. Begin your script in state zero, and then progress from there.

2. Incorporate either the command for player within the zone, or player is within distance of an entity.

3. Assign your script as the main script of either a triggerzone, or a dynamic entity.

Keep working with the .fpi scripting, until you get it. It's not very difficult to learn. Examine an existing stock script, and you'll learn much.

BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 6th Oct 2010 02:06 Edited at: 6th Oct 2010 02:08
If you want this to activate via a trigger zone when an object is picked up, you will need to place an entity to be picked up and place the trigger name in the entity's If Used field. To do that, follow these steps:

1. Place the entity you want the player to pick up
2. Right click the entity to access properties
3. In the If Used field, put the name you will use for the trigger (let's call it Trigger A)

Then place a trigger zone where you want it. You will need to modify the properties so the trigger does not appear until the entity is picked up. To do that, follow these steps:

1. Right click the trigger to access properties
2. In the Script Start, set it to appearifactivate.fpi
3. In the Script Main, place your script you have to display the objectives there.
4. Ensure you name it Trigger A (or whatever you gave the If Used field of the picked-up entity

**ADDITIONAL**

As Seth pointed out, use the plrwithinzone=1 in your script if you want the player to be able to press the key at any time. Use plrdistwithin if they have to be within the zone.

- BlackFox

RPG Mod- Create a world full of adventure
Jonez Games
14
Years of Service
User Offline
Joined: 19th Feb 2010
Location: Finland
Posted: 6th Oct 2010 02:34 Edited at: 6th Oct 2010 03:20
The item system did'nt work, neither trigger zone.
But using Story Zone worked!
Guess I will be using the zones only. Not even much of a problem, cause I always can place a zone with a key, or other objects.

Thanks for the help, I didnt know that it is even possible to spawn/activate zones with out mods(not sure about spawning, maybe it isnt possible, but whatever...)

Atleast it works now!

Thank you very much!


Jonez

EDIT:

I ran in to a problem here.
I tryed to use 2 zones in same level, and now I cant get it working even with a one zone like before.
I'll try to fix this tomorrow...

Brunopark09
14
Years of Service
User Offline
Joined: 7th Jul 2010
Location: Santiago de Chile
Posted: 6th Oct 2010 09:02
Also you can use variables

Y player pick up the item, set globalvar to 1

and if globalvar is 1, and the 0 key is pressed, then show the objetives

SCI FI MEDIA IS NEVER ENOUGH!
Jonez Games
14
Years of Service
User Offline
Joined: 19th Feb 2010
Location: Finland
Posted: 6th Oct 2010 10:33 Edited at: 6th Oct 2010 10:34
The idea is to get multiple huds, atleast 3 or even more activated trough the zones same time by pressing "O".

For example:

First when you press the "O" button: Only empty paper appear.
Then when you go to the zone and activate another hud, objective appear as a different hud, same time as the text.
And then again and again. All the text huds tough have theyr own Y position.

But I can leave the emptypaper, cause there can be problems with it to be a top of the text huds.

But thats the idea, getting new objectives trough zones, without seeing them already.

Jonez

EDIT:
But Im not sure if it works when you use the same script multiple times in same map...

Jonez Games
14
Years of Service
User Offline
Joined: 19th Feb 2010
Location: Finland
Posted: 6th Oct 2010 14:39 Edited at: 6th Oct 2010 14:42
And one extra guestion:

Can I add an enemy, who respawns when dead with random delay(delay could be between 0-15 sec)

I already tryed, and manage to get it respawn inmidietly without delay.

Is this possible? If it is, how?

Thanks

Jonez

Brunopark09
14
Years of Service
User Offline
Joined: 7th Jul 2010
Location: Santiago de Chile
Posted: 7th Oct 2010 02:48
I suppose with the new variable system would be very easy make your script

;Artificial Intelligence Script

;Header

desc = Pickup Item

;Triggers

:state=0:dimvar=obj,setvar=0
:state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\text\pickedupanitem.tga,hudname=itemprompt,hudhide=1,hudmake=display,state=10
:state=10,plrdistwithin=40:state=1,playertake,coloff,plrsound=audiobank\misc\ping.wav,hudshow=itemprompt,hudfadeout=itemprompt,setvar=1
:state=1:rundecal=5

;End of Script


And this scripts for objectives (?)

;Artifical Intelligence Script::::::::::::::::::::::::::

desc = Shows Objectives Text HUD (When O Key Is Pressed)

;Triggers

:state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\text\phobia2\obj\lvl1.dds,hudname=objectives,hudhide=1,hudmake=display

;O Key Pressed
:state=0:dimvar=obj,state=1
:state=1,varequal=1,scancodekeypressed=24:state=2
:state=1:hudunshow=objectives
:state=2:hudshow=objectives,state=1

;End of Script


You need 1.17 to make this script work, not tested yet but it should work

SCI FI MEDIA IS NEVER ENOUGH!
Mr illusionest
15
Years of Service
User Offline
Joined: 5th Mar 2009
Location: Cairo , Egypt
Posted: 7th Oct 2010 13:23
I replied at my thread , you can ckeck it , Jonez .

Cheers

"I am the night visitor when everyone is sleep , and when the last light fades"
The illusionest
Jonez Games
14
Years of Service
User Offline
Joined: 19th Feb 2010
Location: Finland
Posted: 7th Oct 2010 16:03
Quote: "Brunopark09"

Quote: "Mr illusionest"

Thanks, both of you!
I will check these out later

thanks

Jonez

Login to post a reply

Server time is: 2024-11-24 19:45:58
Your offset time is: 2024-11-24 19:45:58