Item Pickup Trigger - Log Modification

Have any questions or problems in making your game, subscribing and/or using our software? Post here.
Forum rules
Make sure you are using the newest version. This can be downloaded at the top of the site via the "downloads" link.

Use a very good subject. "Problem" or "Help" are unacceptable titles.

Use the search feature before posting a question, as the answer is probably already here.

Subscript out of range error 9: This is a generic error, and we'll need way more information than that to figure out the problem. If you get this, strongly consider following the instructions of submitting your project through the Submit Bug feature within the editor.
User avatar
Wonderland
001 Forum Master
 
Joined: Tue Dec 21, 2010 4:18 pm
Location: Canada

Item Pickup Trigger - Log Modification

Postby Wonderland » Tue Aug 09, 2016 7:34 am

I am trying to make it so the log in the "pick up" system trigger only displays the name of an item pickup when you first get it (as most of the enemies in my game drop samey weapons as of right now, and it spams the screen with "You found lazer pistol" a bunch of times. My method as shown below didn't work. Did I miss something? Thanks.

a.png

User avatar
priest865
001 Subscriber
 
Joined: Tue Jul 15, 2008 2:00 am
Location: Hiding Underground

Re: Item Pickup Trigger - Log Modification

Postby priest865 » Tue Aug 09, 2016 7:52 am

I think it's the id. You are searching for the display name ".Title" but I think you need the id ".Name"
Image

User avatar
Wonderland
001 Forum Master
 
Joined: Tue Dec 21, 2010 4:18 pm
Location: Canada

Re: Item Pickup Trigger - Log Modification

Postby Wonderland » Fri Aug 12, 2016 6:25 am

I'll try that. Thanks.

EDIT: It doesn't give an error anymore but now it never shows a log, like I always already have the item. I want it to show a log for the first one you pick up.

User avatar
Kilatorian
001 Support
 
Joined: Sat Oct 18, 2014 12:11 am
Location: Planet Earth

Re: Item Pickup Trigger - Log Modification

Postby Kilatorian » Fri Aug 12, 2016 7:58 am

Open the sub script 'Item and Ammo' and put your item held branch and display log text right after the comparison branch checking for itemName <> "". Where you're putting it now, the itemName has been appeneded to add A or An, etc. so it won't ever line up with your actual item name. Also you should be able to just use itemName instead of Item(itemName).Name, because itemName is the name :D

User avatar
Wonderland
001 Forum Master
 
Joined: Tue Dec 21, 2010 4:18 pm
Location: Canada

Re: Item Pickup Trigger - Log Modification

Postby Wonderland » Sun Aug 14, 2016 8:47 am

Ok thanks. I will try that!


My script now has this, after following your idea. It seems to only announce you've found a pickup when you find your first one, which is what I wanted. However, when it does display the logs, they all say: "***You've picked up .***". In other words, it doesn't say what you picked up. Did I do something wrong? Thanks.

Last edited by Wonderland on Sun Aug 14, 2016 8:46 am, edited 1 time in total.
Reason: Automatically merged double post.

User avatar
Kilatorian
001 Support
 
Joined: Sat Oct 18, 2014 12:11 am
Location: Planet Earth

Re: Item Pickup Trigger - Log Modification

Postby Kilatorian » Sun Aug 14, 2016 1:49 pm

Try changing the variable S in the Display Log Text to itemName, I don't believe the S variable gets anything appended to it until after your display log is ran.

User avatar
Wonderland
001 Forum Master
 
Joined: Tue Dec 21, 2010 4:18 pm
Location: Canada

Re: Item Pickup Trigger - Log Modification

Postby Wonderland » Mon Aug 15, 2016 6:18 am

That works better, but is there a way to use the display name instead of the scripting id?

User avatar
Kilatorian
001 Support
 
Joined: Sat Oct 18, 2014 12:11 am
Location: Planet Earth

Re: Item Pickup Trigger - Log Modification

Postby Kilatorian » Mon Aug 15, 2016 5:18 pm

Yeah, Item(itemName).Title should give you the display name for the item instead of the id.

User avatar
Wonderland
001 Forum Master
 
Joined: Tue Dec 21, 2010 4:18 pm
Location: Canada

Re: Item Pickup Trigger - Log Modification

Postby Wonderland » Tue Aug 16, 2016 8:02 am

Thanks, works great!


Return to Technical Support Questions

Who is online

Users browsing this forum: No registered users

cron