Scripting for stealing objectives?...

Post your scripting questions / solutions here

Moderator: Moderators

User avatar
k47a
товарищ
Posts: 810
Joined: Fri Mar 25, 2005 1:19 pm

Post by k47a »

Thanks so much!!!
// remove the docs
// should have a trigger_use with a setthread to this thread.
// i dont remember the command, but you also need to clear that object and set a new one after this
Trigger_use? Not trigger_multiple as said in the tut? And what does
setthread to this thread
exactly mean? And what about "clear and object"
Image
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

Trigger_multiple is triggered when a player enters its volume. Trigger_use is triggered when a player presses use in its volume. It's really up to you.

Setthread is a method of calling threads by the trigger itself so that you don't need a loop to be running. You can set it by the entity properties window in Radiant:
1. Select the trigger.
2. Hit N.
3. Enter key/value:
setthread my_thread_label
And when the trigger is triggered, it will create a ScriptThread instance at the label given with the self object being the trigger.
IvaN wrote:And what about "clear and object"
I don't understand it either. :?
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

:oops:

i was certain i commented it more than that...

ok, a setthread is a key/value, when something is triggered (like somebody making a trigger go off or an AI hitting a certain pathnode) it calls the thread in the setthread. So in this case, have your trigger have a key/value of

setthread/lorrydisable

also i made a typo with a capital so that script wont work :oops: edited.

with objective.scr, it has routines for making, showing, showing as current obj, and clearing obj's. But, i haven't used objectives in a long time so i don't remember what the setting as done method is...One of the stock map scripts will have it in it, or one of the tuts ;)

EDIT:
clear that object
clear the objective
typo.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
k47a
товарищ
Posts: 810
Joined: Fri Mar 25, 2005 1:19 pm

Post by k47a »

So, I got it like this (yeah, I thought it should be with 's'):
main:


//////////////////
level waittill spawn
//////////////////

thread prep
thread objs

end

objs:
//handles the objectives for the mission.

$documents_tirgger waittill trigger

waitthread global/objectives.scr::add_objectives 1 2 "Steal the documents." $documents.origin //compass!
waitthread global/objectives.scr::current_objectives 1

end


objective1:

$player playsound pickup_papers
$documents remove
iprintln "Document taken."

end
(I took out all the useless stuff (well, useless in this case))

So, when I trigger the docs, they disappear, that's fine. What doesn't work is that I don't really "obey my orders", that is, do what's said when hitting tab. I can take the documents (btw, when doing so, I get a message in German, although all the rest I scripted is in English) but then the compass still points to where they actually were...
I checked with the m2/1 script and just took over some things...
What do I have to change or add to make things work smooth?

Btw, I got a setthread on (?) the trigger (cnt/1 and setthread/objectives1)...
Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

right, you need to tell the objectives script to show that obj as "finished".

Straight from m1l1

Code: Select all

waitthread global/objectives.scr::add_objectives 1 3 "Infiltrate the German occupied village."
object 1, type 3.
type 1 is it's hidden
type 2 is it's shown
type 3 is it's done.

example...

Code: Select all

		waitthread global/objectives.scr::add_objectives 1 3 "Infiltrate the German occupied village." ( -6296 1640 480)
		waitthread global/objectives.scr::add_objectives 2 2 "Check the door." $ending_door.origin
		waitthread global/objectives.scr::add_objectives 3 1 "Man the MG42 mounted machine gun." $mg42.origin
		waitthread global/objectives.scr::add_objectives 4 1 "Hold off the reinforcements." $mg42.origin
		waitthread global/objectives.scr::add_objectives 5 1 "Continue on your mission." $endthelevel.origin
		waitthread global/objectives.scr::current_objectives 2
obj 1 (Infiltrate) is finished, thus the 3. obj 2 (Check the Door) is current, thus the 2, if it's current it needs to be shown. and all others are 1, because they're not shown.

So your script would use...

Code: Select all

objective1: 

$player playsound pickup_papers 
$documents remove 
iprintln "Document taken." 

waitthread global/objectives.scr::add_objectives 1 3 "Steal the documents." $documents.origin //compass! 
waitthread global/objectives.scr::current_objectives 0 

end
This line is not needed, since your trigger is already got it's thread to start when it's triggered, this waittill is just wasting processor power.

Code: Select all

$documents_tirgger waittill trigger
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
k47a
товарищ
Posts: 810
Joined: Fri Mar 25, 2005 1:19 pm

Post by k47a »

Ay! It works :D . Is it possible the get the message when I took the docs in English? Would I have to make an inprintln-thing in the script (Like Rookie did for the truck)?
Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

Yep, You'll have to choose a way to display the thingie (centerprint, iprintln locationprint etc) and then use that in your script, i believe stufftext is the command used for MP, not sure though. Check the Rjukan Project.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
k47a
товарищ
Posts: 810
Joined: Fri Mar 25, 2005 1:19 pm

Post by k47a »

lizardkid wrote:Check the Rjukan Project.
Yeah, check out that link... :?
But, thanks a lot!
Image
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

Why is it so easy for companies to let just anyone say there the owner of the site, And give them there passwords for the site, Should be more protection against this kinda thing!

http://gronnevik.se/rjukan/ <------Hacked
Last edited by Green Beret on Wed May 04, 2005 6:52 pm, edited 3 times in total.
Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

i actually didnt put that there... putting a real link in now.

EDIT: holy shit you're right beret, that is hacked.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

Note that centerprint does not work.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

actually a server can send centerprint t all clients, CI does it. i dont kno how but i know it's possible.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
k47a
&#1090;&#1086;&#1074;&#1072;&#1088;&#1080;&#1097;
Posts: 810
Joined: Fri Mar 25, 2005 1:19 pm

Post by k47a »

lizardkid wrote: EDIT: holy shit you're right beret, that is hacked.
Yeah, I saw that - they actually even say it (top line)... I wonder how's that possible :?
They sure have to hack the site I need :x !

Hell, I'm a real stupid kid: I just deleted my script :evil: ... Wonder how I managed... Sure glad there's an almost finished version posted here *regaining consciousness*...
Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

Yeah, I saw that - they actually even say it (top line)... I wonder how's that possible
They sure have to hack the site I need !
They use roundabout exploits and hidden files publicly accessable to all users but that only crackers know about. then they simply take over the site, replace with whatever they want, and laugh it up.

for instance i know how to get the password for any Windows user simplyby using two floppies a simple compression program and DOS.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

http://gronnevik.se/rjukan/

EDIT:Oh so now its fixed....Happy Happy Joy Joy
Last edited by Green Beret on Thu May 05, 2005 5:51 pm, edited 2 times in total.
Image
Post Reply